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:
parent
e983c672d4
commit
0c7824bf49
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue