1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

libvirt volume sizes are in GB, ensuring both requests and setters are in GB

This commit is contained in:
Ohad Levy 2012-04-04 15:52:51 +03:00 committed by Ohad Levy
parent e983c672d4
commit 0c7824bf49

View file

@ -34,11 +34,15 @@ module Fog
:path => vol.path, :path => vol.path,
:name => vol.name, :name => vol.name,
:format_type => format_type, :format_type => format_type,
:allocation => vol.info.allocation, :allocation => bytes_to_gb(vol.info.allocation),
:capacity => vol.info.capacity, :capacity => bytes_to_gb(vol.info.capacity),
} }
end end
def bytes_to_gb bytes
bytes / 1024**3
end
def raw_volumes def raw_volumes
client.list_storage_pools.each do |pool_name| client.list_storage_pools.each do |pool_name|
pool = client.lookup_storage_pool_by_name(pool_name) pool = client.lookup_storage_pool_by_name(pool_name)