From 3834726134cb91ceebf2e2fc97772d9debf086e5 Mon Sep 17 00:00:00 2001 From: Eric Johnson Date: Wed, 2 Apr 2014 16:11:17 +0000 Subject: [PATCH] [google|compute] allow user to set disk description --- lib/fog/google/models/compute/disk.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/fog/google/models/compute/disk.rb b/lib/fog/google/models/compute/disk.rb index 1e3112c87..af8a137fb 100644 --- a/lib/fog/google/models/compute/disk.rb +++ b/lib/fog/google/models/compute/disk.rb @@ -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}