deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/5] Client: Added base64#encode for user_data (DTACLOUD-522)
Date Wed, 03 Apr 2013 14:20:00 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 client/lib/deltacloud/client.rb                  | 1 +
 client/lib/deltacloud/client/methods/instance.rb | 1 +
 2 files changed, 2 insertions(+)

diff --git a/client/lib/deltacloud/client.rb b/client/lib/deltacloud/client.rb
index c7048dd..7304146 100644
--- a/client/lib/deltacloud/client.rb
+++ b/client/lib/deltacloud/client.rb
@@ -19,6 +19,7 @@ module Deltacloud
     require 'ostruct'
     require 'nokogiri'
     require 'faraday'
+    require 'base64'
 
     # Core extensions
     require_relative './core_ext'
diff --git a/client/lib/deltacloud/client/methods/instance.rb b/client/lib/deltacloud/client/methods/instance.rb
index 506c338..3ed6a31 100644
--- a/client/lib/deltacloud/client/methods/instance.rb
+++ b/client/lib/deltacloud/client/methods/instance.rb
@@ -52,6 +52,7 @@ module Deltacloud::Client
       # Returns created instance, or list of created instances or all instances.
       #
       def create_instance(image_id, create_opts={})
+        create_opts[:user_data] = Base64::encode64(create_opts[:user_data]) if create_opts[:user_data]
         r = create_resource :instance, create_opts.merge(
           :image_id => image_id,
           :no_convert_model => true
-- 
1.8.1.4


Mime
View raw message