From 3f221ba83b8d890f10c7e73d188b34cff4e778d2 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 24 Oct 2011 16:11:33 +0530 Subject: [PATCH] [Brightbox] Change logic of fetching zone and flavour_id --- lib/fog/brightbox/models/compute/server.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/fog/brightbox/models/compute/server.rb b/lib/fog/brightbox/models/compute/server.rb index 223ea7ffe..2ba860386 100644 --- a/lib/fog/brightbox/models/compute/server.rb +++ b/lib/fog/brightbox/models/compute/server.rb @@ -41,11 +41,19 @@ module Fog end def zone_id - attributes[:zone_id] || zone[:id] || zone['id'] + if t_zone_id = attributes[:zone_id] + t_zone_id + elsif zone + zone[:id] || zone['id'] + end end def flavor_id - attributes[:flavor_id] || server_type[:id] || server_type['id'] + if t_flavour_id = attributes[:flavor_id] + t_flavour_id + elsif server_type + server_type[:id] || server_type['id'] + end end def zone_id=(incoming_zone_id)