Permalink
Browse files

Virtualbox user-data isn't base64 encoded (STEAM-310)

  • Loading branch information...
1 parent 4635458 commit 58883ca2570c98e7d1a4101b1e24e0cef9d9b68f @bbrowning bbrowning committed Jan 14, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/sc-agent/helpers/cloud-helper.rb
  2. +1 −1 spec/helpers/cloud-helper-spec.rb
@@ -96,7 +96,7 @@ def read_certificate( platform )
begin
encoded_data = `#{VBOX_CONTROL} guestproperty get /Deltacloud/UserData | grep Value`
encoded_data.gsub!(/^Value: (.+)/, '\1')
- data = JSON.parse(Base64.decode64(encoded_data), :symbolize_names => true)
+ data = JSON.parse(encoded_data, :symbolize_names => true)
return nil unless data.is_a?(Hash)
return data[:steamcannon_ca_cert]
rescue => e
@@ -63,7 +63,7 @@ module SteamCannon
end
it "should read certificate for Virtualbox" do
- @helper.should_receive('`').and_return("Value: " + Base64.encode64('{ "steamcannon_ca_cert": "CERT" }'))
+ @helper.should_receive('`').and_return('Value: { "steamcannon_ca_cert": "CERT" }')
@helper.read_certificate(:virtualbox).should == "CERT"
end

0 comments on commit 58883ca

Please sign in to comment.