deltacloud-dev mailing list archives

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

ACK.

(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)
>


-- 

Michal Fojtik <mfojtik@redhat.com>
Deltacloud API, CloudForms

Mime
View raw message