mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
fixing whitespace
This commit is contained in:
parent
02f5da397c
commit
f6e8492db4
4 changed files with 20 additions and 20 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -22,4 +22,4 @@ module Fog
|
|||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue