CLOUDSTACK-2450: Fix userdata to be urlencoded safely

urlencoding the userdata and quoting the = since apiserver will strip
them out. This will send an invalid userdata down to the plugin (vmops)
where base64 decoding fails causing vm deployment to fail.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2013-07-26 19:20:29 +05:30
parent 32c8cd3cd7
commit 4be18aefc4

View File

@ -376,7 +376,7 @@ class VirtualMachine:
cmd.hostid = hostid
if "userdata" in services:
cmd.userdata = base64.b64encode(services["userdata"])
cmd.userdata = base64.urlsafe_b64encode(services["userdata"])
if group:
cmd.group = group