deltacloud-dev mailing list archives

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

     [ https://issues.apache.org/jira/browse/DTACLOUD-311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Marios Andreou updated DTACLOUD-311:
------------------------------------

    Attachment: 0004-UNDOME.patch

updates machine and machine_config fixtures for cimi tests.

reproduce the error described above:

1) rake cimi:test:models ==> error

  1) Error:
test_0001_can be constructed from XML and JSON(MachineConfiguration model):
NameError: no member 'capacity' in struct
    /home/marios/Documents/WORK/NewEclipsey/DCore/deltacloud_git_repo/deltacloud/server/lib/cimi/models/schema.rb:66:in
`[]='


2) run same test manually: 

ruby ./cimi/spec/cimi/model/machine_configuration_spec.rb ==> 1 tests, 4 assertions, 0
failures, 0 errors, 0 skips

                
> 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
>         Attachments: 0004-UNDOME.patch
>
>
> 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