On 18/02/10 12:23 -0800, David Lutterkort wrote:
On Thu, 2010-02-18 at 15:57 +0100, mfojtik@redhat.com wrote:
- def instances
- def instances(id=nil) instances = [] request( entry_points[:instances] ) do |response| doc = REXML::Document.new( response.body )
@@ -249,7 +281,7 @@ class DeltaCloud end end
- def storage_volumes
- def storage_volumes(id=nil) storage_volumes = [] request( entry_points[:storage_volumes] ) do |response| doc = REXML::Document.new( response.body )
@@ -278,7 +310,7 @@ class DeltaCloud nil end
- def storage_snapshots()
- def storage_snapshots(id=nil) storage_snapshots = [] request( entry_points[:storage_snapshots] ) do |response| doc = REXML::Document.new( response.body )
Why are you adding these id parameters ? They aren't used in the method bodies at all.
Unfortunately, I calling this methods from client (command line):
client.send(options[:collection].to_s, params).each do |model| ...
Without this 'optional' params, this one line of code will expand to couple lines of code ;) (deltacloud.rb: In 'flavors' there are 'opts={}' parameter, but in 'instances' or 'storage_volumes' there are no parameters at all...)
@@ -345,7 +377,7 @@ class DeltaCloud :authorization => "Basic "+Base64.encode64("#{@name}:#{@password}"), :accept => "application/xml" }
- logger << "Request [#{method.to_s.upcase}] #{request_path}]\n"
- # logger << "Request [#{method.to_s.upcase}] #{request_path}]\n" if method.eql?(:get) RestClient.send(method, request_path, headers, &block) else
We should find a way to conditionally log this, maybe controlled by some env variable.
I tried:
attr_accessor :verbose
but unfortunately this method is 'private'...