Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 58883ca2570c98e7d1a4101b1e24e0cef9d9b68f 1 parent 4635458
@bbrowning bbrowning authored
View
2  lib/sc-agent/helpers/cloud-helper.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
View
2  spec/helpers/cloud-helper-spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.