deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michal Fojtik (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DTACLOUD-311) CIMI models can't share attribute with same name but different definition
Date Tue, 04 Sep 2012 12:44:08 GMT
Michal Fojtik created DTACLOUD-311:
--------------------------------------

             Summary: CIMI models can't share attribute with same name but different definition
                 Key: DTACLOUD-311
                 URL: https://issues.apache.org/jira/browse/DTACLOUD-311
             Project: DeltaCloud
          Issue Type: Bug
          Components: CIMI/Frontend
            Reporter: Michal Fojtik


In current CIMI DSL if you have two models that use attributes with the same name but the
attributes have different definitions (eg. type) they override each other. For example:

class Model1 < CIMI::Model::Base
  href :disks
end

class Model2 < CIIMI::Model::Base
  array :disks do
    scalar :capacity
  end
end

If you then try to stick a 'href' value (eg. link to referenced :disk resource) on Model1
you get this exception:

NameError: no member 'capacity' in struct
    /Users/mfojtik/code/core/server/lib/cimi/models/schema.rb:66:in `[]='

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message