deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/2] git commit: Add user-data support to openstack driver.
Date Thu, 08 Nov 2012 09:57:04 GMT
Add user-data support to openstack driver.

This patch adds user-data support for openstack backend driver.

Signed-off-by: Ian Main <imain@redhat.com>


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/33bb4363
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/33bb4363
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/33bb4363

Branch: refs/heads/master
Commit: 33bb4363a3e712d2b587177131aff63b8f26c00a
Parents: 0f058b8
Author: Ian Main <imain@redhat.com>
Authored: Thu Nov 1 12:51:37 2012 -0700
Committer: marios <marios@redhat.com>
Committed: Thu Nov 8 11:44:57 2012 +0200

----------------------------------------------------------------------
 .../drivers/openstack/openstack_driver.rb          |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/33bb4363/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
index fef9e39..7fbfd48 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
@@ -171,7 +172,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