You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by "Dies Koper (JIRA)" <ji...@apache.org> on 2013/04/05 17:43:16 UTC
[jira] [Updated] (DTACLOUD-525) Unable to perform operations on
CIMI::Model
[ https://issues.apache.org/jira/browse/DTACLOUD-525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dies Koper updated DTACLOUD-525:
--------------------------------
Attachment: 0001-I-have-no-idea-how-this-works.patch
0005-CIMI-fix-system-operations-start-stop-and-use-rabbit.patch
I have made the change in patch 0005. It seems to work, but now /cimi/systems?format=xml returns an xml error for both cimi and fgcp (see below). The error is gone if I apply patch 0001. Why?
E, [2013-04-06T00:36:15.771890 #9196] ERROR -- 500: [ArgumentError] Use of uninitialized value!
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:801:in `block in value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:797:in `each'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:797:in `value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:813:in `block in value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:797:in `each'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:797:in `value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:854:in `block in value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:848:in `each'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:848:in `value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:813:in `block in value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:797:in `each'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:797:in `value_to_xml'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:239:in `xml_out'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.2/lib/xmlsimple.rb:259:in `xml_out'
d:/sources/OSS/cloud/deltacloud/server/lib/cimi/models/resource.rb:148:in `to_xml'
d:/sources/OSS/cloud/deltacloud/server/lib/cimi/models/resource.rb:197:in `to_xml'
d:/sources/OSS/cloud/deltacloud/server/lib/cimi/helpers/cimi_rabbit_helper.rb:37:in `block (4 levels) in generate_index_operation'
d:/sources/OSS/cloud/deltacloud/server/lib/sinatra/rack_accept.rb:103:in `call'
d:/sources/OSS/cloud/deltacloud/server/lib/sinatra/rack_accept.rb:103:in `respond_to'
d:/sources/OSS/cloud/deltacloud/server/lib/cimi/helpers/cimi_rabbit_helper.rb:36:in `block (2 levels) in generate_index_operation'
D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-rabbit-1.1.6/lib/sinatra/rabbit/base.rb:400:in `instance_eval'
127.0.0.1 - - [06/Apr/2013 00:36:15] "GET /cimi/systems?format=xml HTTP/1.1" 500 125336 10.7390
> 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