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,
:name => vol.name,
:format_type => format_type,
:allocation => vol.info.allocation,
:capacity => vol.info.capacity,
:allocation => bytes_to_gb(vol.info.allocation),
:capacity => bytes_to_gb(vol.info.capacity),
}
end
def bytes_to_gb bytes
bytes / 1024**3
end
def raw_volumes
client.list_storage_pools.each do |pool_name|
pool = client.lookup_storage_pool_by_name(pool_name)