From 99961f32f7c0702f1f1641ca48bb8d40e7428b10 Mon Sep 17 00:00:00 2001 From: heyryanw Date: Thu, 8 Nov 2012 05:13:15 -0800 Subject: [PATCH] Adding explicit support for metadata for Rackspace compute_v2. --- lib/fog/rackspace/models/compute_v2/server.rb | 1 + lib/fog/rackspace/requests/compute_v2/create_server.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/fog/rackspace/models/compute_v2/server.rb b/lib/fog/rackspace/models/compute_v2/server.rb index 4b9ff26eb..7a690cb2d 100644 --- a/lib/fog/rackspace/models/compute_v2/server.rb +++ b/lib/fog/rackspace/models/compute_v2/server.rb @@ -56,6 +56,7 @@ module Fog requires :name, :image_id, :flavor_id options = {} options[:disk_config] = disk_config unless disk_config.nil? + options[:metadata] = metadata unless metadata.nil? data = connection.create_server(name, image_id, flavor_id, 1, 1, options) merge_attributes(data.body['server']) true diff --git a/lib/fog/rackspace/requests/compute_v2/create_server.rb b/lib/fog/rackspace/requests/compute_v2/create_server.rb index b12367782..1fefcb647 100644 --- a/lib/fog/rackspace/requests/compute_v2/create_server.rb +++ b/lib/fog/rackspace/requests/compute_v2/create_server.rb @@ -13,6 +13,7 @@ module Fog } } + data['server']['metadata'] = options[:metadata] unless options[:metadata].nil? data['server']['OS-DCF:diskConfig'] = options[:disk_config] unless options[:disk_config].nil? request(