From 0738a84cf6ce9c5a76661a9e7709be93075f11fc Mon Sep 17 00:00:00 2001 From: NomadRain Date: Fri, 14 Oct 2011 23:19:12 +0400 Subject: [PATCH] [clodo|compute] Bug fixes. --- lib/fog/clodo/models/compute/image.rb | 8 ++++---- lib/fog/clodo/models/compute/server.rb | 13 ++----------- lib/fog/clodo/requests/compute/create_server.rb | 1 - 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/lib/fog/clodo/models/compute/image.rb b/lib/fog/clodo/models/compute/image.rb index 43ce2957e..c0ac0dbe3 100644 --- a/lib/fog/clodo/models/compute/image.rb +++ b/lib/fog/clodo/models/compute/image.rb @@ -15,10 +15,10 @@ module Fog attribute :os_bits attribute :os_hvm - def initialize(new_attributes) - super(new_attributes) - merge_attributes(new_attributes['_attr']) if new_attributes['_attr'] - end + def initialize(new_attributes) + super(new_attributes) + merge_attributes(new_attributes['_attr']) if new_attributes['_attr'] + end def ready? status == 'ACTIVE' diff --git a/lib/fog/clodo/models/compute/server.rb b/lib/fog/clodo/models/compute/server.rb index 413262abf..33cc5dd18 100644 --- a/lib/fog/clodo/models/compute/server.rb +++ b/lib/fog/clodo/models/compute/server.rb @@ -44,7 +44,7 @@ module Fog def initialize(attributes={}) self.image_id ||= attributes[:vps_os] ? attributes[:vps_os] : 666 - super + super attributes end def destroy @@ -98,11 +98,7 @@ module Fog def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity requires :image_id - options = { - 'name' => name - } - options = options.reject {|key, value| value.nil?} - data = connection.create_server(image_id, options) + data = connection.create_server(image_id, attributes) merge_attributes(data.body['server']) true end @@ -114,7 +110,6 @@ module Fog %{echo "#{public_key}" >> ~/.ssh/authorized_keys}, %{passwd -l #{username}}, %{echo "#{MultiJson.encode(attributes)}" >> ~/attributes.json}, - %{echo "#{MultiJson.encode(metadata)}" >> ~/metadata.json} ]) rescue Errno::ECONNREFUSED sleep(1) @@ -147,10 +142,6 @@ module Fog private -### def adminPass=(new_admin_pass) -### @vps_root_pass= new_admin_pass -### end - end end diff --git a/lib/fog/clodo/requests/compute/create_server.rb b/lib/fog/clodo/requests/compute/create_server.rb index 1e92a2aed..670618534 100644 --- a/lib/fog/clodo/requests/compute/create_server.rb +++ b/lib/fog/clodo/requests/compute/create_server.rb @@ -21,7 +21,6 @@ module Fog data = { 'server' => { :vps_os => image_id, - :vps_type => options[:vps_type]?options[:vps_type]:'ScaleServer', :vps_hdd => options[:vps_hdd]?options[:vps_hdd]:5, :vps_memory => options[:vps_memory]?options[:vps_memory]:256, :vps_memory_max => options[:vps_memory_max]?options[:vps_memory_max]:1024,