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

[clodo|compute] Bug fixes.

This commit is contained in:
NomadRain 2011-10-14 23:19:12 +04:00
parent fe2dacec55
commit 0738a84cf6
3 changed files with 6 additions and 16 deletions

View file

@ -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'

View file

@ -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

View file

@ -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,