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

move Base64 encoding stuff down to low level calls

This commit is contained in:
Wesley Beary 2009-10-21 14:50:27 -07:00
parent 7b5d28ed09
commit 5053b3e357
2 changed files with 4 additions and 2 deletions

View file

@ -16,7 +16,6 @@ module Fog
attribute :key_name, 'keyName' attribute :key_name, 'keyName'
attribute :launch_time, 'launchTime' attribute :launch_time, 'launchTime'
attribute :monitoring attribute :monitoring
attribute :placement
attribute :product_codes, 'productCodes' attribute :product_codes, 'productCodes'
attribute :private_dns_name, 'privateDnsName' attribute :private_dns_name, 'privateDnsName'
attribute :ramdisk_id, 'ramdiskId' attribute :ramdisk_id, 'ramdiskId'
@ -97,7 +96,7 @@ module Fog
options['RamdiskId'] = @ramdisk_id options['RamdiskId'] = @ramdisk_id
end end
if @user_data if @user_data
options['UserData'] = Base64.encode64(@user_data) options['UserData'] = @user_data
end end
data = connection.run_instances(@image_id, 1, 1, options) data = connection.run_instances(@image_id, 1, 1, options)
merge_attributes(data.body['instancesSet'].first) merge_attributes(data.body['instancesSet'].first)

View file

@ -64,6 +64,9 @@ unless Fog.mocking?
# * 'requestId'<~String> - Id of request # * 'requestId'<~String> - Id of request
# * 'reservationId'<~String> - Id of reservation # * 'reservationId'<~String> - Id of reservation
def run_instances(image_id, min_count, max_count, options = {}) def run_instances(image_id, min_count, max_count, options = {})
if options['UserData']
options['UserData'] = Base64.encode64(options['UserData'])
end
request({ request({
'Action' => 'RunInstances', 'Action' => 'RunInstances',
'ImageId' => image_id, 'ImageId' => image_id,