[ https://issues.apache.org/jira/browse/DTACLOUD-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13623934#comment-13623934 ]
Michal Fojtik commented on DTACLOUD-525: ---------------------------------------- 0001-I-have-no-idea-how-this-works.patch No idea why calling .to_xml on all entries will fix this problem. My suspicion is that when you wrap entries to collection, something changes inside entries schema that cause generation of { :href => nil } for 'sub-collections' included in those entries. David, could you check it pls? > Unable to perform operations on CIMI::Model > ------------------------------------------- > > Key: DTACLOUD-525 > URL: https://issues.apache.org/jira/browse/DTACLOUD-525 > Project: DeltaCloud > Issue Type: Bug > Reporter: Michal Fojtik > Assignee: Dies Koper > Priority: Blocker > Attachments: 0001-I-have-no-idea-how-this-works.patch, > 0005-CIMI-fix-system-operations-start-stop-and-use-rabbit.patch > > > Today Dies found an interesting issue in CIMI::Model vs CIMI::Service: > mock_driver_cimi_methods.rb: > def systems(credentials, opts={}) > check_credentials(credentials) > if opts[:id].nil? > systems = @client.load_all_cimi(:system).map{|sys| > CIMI::Model::System.from_json(sys)} > else > begin > systems = [CIMI::Model::System.from_json(@client.load_cimi(:system, > opts[:id]))] > rescue Errno::ENOENT > return [] > end > end > systems.map{|sys| convert_urls(sys, opts[:env])}.flatten > end > As you can see, this method will return CIMI::Model::System, which is fine if > you want to serialize it directly to JSON/XML. However, this is how we define > 'stop' operation in Rabbit: > action :stop, :with_capability => :stop_system do > description "Stop specific system." > param :id, :string, :required > control do > system = System.find(params[:id], self) > action = Action.parse(self) > system.perform(action, self) do |operation| > no_content_with_status(202) if operation.success? > # Handle errors using operation.failure? > end > end > end > In this case, "system.perform" will fail with: > undefined method `perform' for #<CIMI::Model::System:0x00000003d154b8> > The .perform() method is defined for CIMI::Service::System. Any clues how to > fix this? -- 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