[
https://issues.apache.org/jira/browse/DTACLOUD-311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447659#comment-13447659
]
Marios Andreou edited comment on DTACLOUD-311 at 9/4/12 11:46 PM:
------------------------------------------------------------------
(attached 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
was (Author: marios):
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