deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: [PATCH] Add user-data support to openstack driver.
Date Fri, 02 Nov 2012 09:07:16 GMT
On 02/11/12 11:02, Michal Fojtik wrote:
> On 11/01/2012 08:51 PM, Ian Main wrote:
> 
> ACK.
> 

hold on, am a bit confused. 'user-data' is already supported by the
'server personality' as documented in the API [1] ... is 'user-data'
something different?

marios


[1]
http://docs.openstack.org/api/openstack-compute/2/content/CreateServers.html

> (Same question with ICLA ;-)
> 
>   -- Michal
> 
>> This patch adds user-data support for openstack backend driver.
>>
>> Signed-off-by: Ian Main <imain@redhat.com>
>> ---
>>   server/lib/deltacloud/drivers/openstack/openstack_driver.rb | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git
>> a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
>> b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
>> index 5c40425..f7c18b6 100644
>> --- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
>> +++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
>> @@ -16,6 +16,7 @@
>>
>>   require 'openstack'
>>   require 'tempfile'
>> +require 'base64'
>>
>>   module Deltacloud
>>     module Drivers
>> @@ -160,7 +161,10 @@ module Deltacloud
>>             end
>>             if opts[:keyname] && opts[:keyname].length > 0
>>               params[:key_name]=opts[:keyname]
>> -          end
>> +      end
>> +      if opts[:user_data] && opts[:user_data].length > 0
>> +        params[:user_data]=Base64.encode64(opts[:user_data])
>> +      end
>>             safely do
>>               server = os.create_server(params)
>>               result = convert_from_server(server,
>> os.connection.authuser)
>>
> 
> 


Mime
View raw message