diff --git a/lib/fog/compute/models/libvirt/pool.rb b/lib/fog/compute/models/libvirt/pool.rb index 9f850b280..ea192f5d3 100644 --- a/lib/fog/compute/models/libvirt/pool.rb +++ b/lib/fog/compute/models/libvirt/pool.rb @@ -153,11 +153,11 @@ module Fog def state requires :raw - #INACTIVE = INT2NUM(VIR_STORAGE_POOL_INACTIVE) virStoragePoolState - #BUILDING = INT2NUM(VIR_STORAGE_POOL_BUILDING) - #RUNNING = INT2NUM(VIR_STORAGE_POOL_RUNNING) - #DEGRADED = INT2NUM(VIR_STORAGE_POOL_DEGRADED) - #INACCESSIBLE = INT2NUM(VIR_STORAGE_POOL_INACCESSIBLE) + #INACTIVE = INT2NUM(VIR_STORAGE_POOL_INACTIVE) virStoragePoolState + #BUILDING = INT2NUM(VIR_STORAGE_POOL_BUILDING) + #RUNNING = INT2NUM(VIR_STORAGE_POOL_RUNNING) + #DEGRADED = INT2NUM(VIR_STORAGE_POOL_DEGRADED) + #INACCESSIBLE = INT2NUM(VIR_STORAGE_POOL_INACCESSIBLE) states=[:inactive, :building,:running,:degrated,:inaccessible] return states[@raw.info.state] diff --git a/lib/fog/compute/models/libvirt/servers.rb b/lib/fog/compute/models/libvirt/servers.rb index 79cf9afaf..be6857094 100644 --- a/lib/fog/compute/models/libvirt/servers.rb +++ b/lib/fog/compute/models/libvirt/servers.rb @@ -30,10 +30,10 @@ module Fog end data << { :raw => domain } end - + load(data) end - + def get(uuid) self.all(:uuid => uuid).first end @@ -46,9 +46,9 @@ module Fog # server.setup(:password => server.password) # server end - + # private #making these internals private screws up reload - + # Retrieve the server by uuid def get_by_uuid(uuid) server=connection.lookup_domain_by_uuid(uuid) @@ -59,7 +59,7 @@ module Fog # Retrieve the server by name def get_by_name(name) server=connection.lookup_domain_by_name(name) - return server + return server # new(:raw => machine) end diff --git a/lib/fog/compute/models/libvirt/util.rb b/lib/fog/compute/models/libvirt/util.rb index 1f1ba228a..11d56ad26 100644 --- a/lib/fog/compute/models/libvirt/util.rb +++ b/lib/fog/compute/models/libvirt/util.rb @@ -22,4 +22,4 @@ module Fog end end -end \ No newline at end of file +end diff --git a/lib/fog/compute/models/libvirt/volumes.rb b/lib/fog/compute/models/libvirt/volumes.rb index 2769a40a7..553911d5d 100644 --- a/lib/fog/compute/models/libvirt/volumes.rb +++ b/lib/fog/compute/models/libvirt/volumes.rb @@ -10,7 +10,7 @@ module Fog model Fog::Compute::Libvirt::Volume def all(filter=nil) - data=[] + data=[] if filter.nil? connection.list_storage_pools.each do |poolname| pool=connection.lookup_storage_pool_by_name(poolname) @@ -25,7 +25,7 @@ module Fog volume=self.get_by_key(filter[:key]) if filter.has_key?(:key) volume=self.get_by_path(filter[:path]) if filter.has_key?(:path) return nil if volume.nil? - + rescue ::Libvirt::RetrieveError return nil end @@ -39,16 +39,16 @@ module Fog self.all(:key => key).first end - + # Retrieve the volume by name def get_by_name(name) connection.list_storage_pools.each do |poolname| pool=connection.lookup_storage_pool_by_name(poolname) volume=pool.lookup_volume_by_name(name) - unless volume.nil? + unless volume.nil? return volume end - end + end return nil end @@ -58,10 +58,10 @@ module Fog connection.list_storage_pools.each do |poolname| pool=connection.lookup_storage_pool_by_name(poolname) volume=pool.lookup_volume_by_key(key) - unless volume.nil? + unless volume.nil? return volume end - end + end return nil end @@ -71,10 +71,10 @@ module Fog connection.list_storage_pools.each do |poolname| pool=connection.lookup_storage_pool_by_name(poolname) volume=pool.lookup_volume_by_key(path) - unless volume.nil? + unless volume.nil? return volume end - end + end return nil end