← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~jvassev/cloud-init:fix-b64decode-ovf into cloud-init:master

 

Julian Vassev has proposed merging ~jvassev/cloud-init:fix-b64decode-ovf into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~jvassev/cloud-init/+git/cloud-init/+merge/305462

base64.decodestring takes a bytes-like object, a simple fix to convert str to bytes.
-- 
Your team cloud init development team is requested to review the proposed merge of ~jvassev/cloud-init:fix-b64decode-ovf into cloud-init:master.
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py
index 43347cf..4ae030a 100644
--- a/cloudinit/sources/DataSourceOVF.py
+++ b/cloudinit/sources/DataSourceOVF.py
@@ -268,7 +268,7 @@ def read_ovf_environment(contents):
             cfg[prop] = val
         elif prop == "user-data":
             try:
-                ud = base64.decodestring(val)
+                ud = base64.decodestring(bytes(val, 'utf-8'))
             except Exception:
                 ud = val
     return (md, ud, cfg)

Follow ups