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

Allow setting userdata as plain ascii or b64.

This commit is contained in:
Todd Willey 2011-10-13 23:14:34 -04:00
parent 2735f5291f
commit 24e4bae57f

View file

@ -21,6 +21,7 @@ module Fog
attribute :accessIPv4
attribute :accessIPv6
attribute :availability_zone
attribute :user_data_encoded
attribute :state, :aliases => 'status'
attr_reader :password
@ -47,6 +48,10 @@ module Fog
metadata.load(metas)
end
def user_data=(ascii_userdata)
self.user_data_encoded = [ascii_userdata].pack('m')
end
def destroy
requires :id
connection.delete_server(id)
@ -155,7 +160,8 @@ module Fog
'personality' => personality,
'accessIPv4' => accessIPv4,
'accessIPv6' => accessIPv6,
'availability_zone' => availability_zone
'availability_zone' => availability_zone,
'user_data' => user_data_encoded
}
options = options.reject {|key, value| value.nil?}
data = connection.create_server(name, image_ref, flavor_ref, options)