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

[google|compute] allow user to set disk description

This commit is contained in:
Eric Johnson 2014-04-02 16:11:17 +00:00
parent fef4d12e20
commit 3834726134

View file

@ -25,11 +25,17 @@ module Fog
requires :zone_name
options = {}
my_description = "Created with fog"
if !source_image.nil?
my_description = "Created from image: #{source_image}"
end
if source_image.nil? && !source_snapshot.nil?
options['sourceSnapshot'] = source_snapshot
my_description = "Created from snapshot: #{source_snapshot}"
end
options['sizeGb'] = size_gb
options['description'] = description || my_description
data = service.insert_disk(name, zone_name, source_image, options).body
data = service.backoff_if_unfound {service.get_disk(name, zone_name).body}