deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Main <im...@redhat.com>
Subject [PATCH] Add user-data support to openstack driver.
Date Thu, 01 Nov 2012 19:51:37 GMT
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)
-- 
1.7.11.7


Mime
View raw message