← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~smoser/cloud-init:fix/1792157-openstack-md-version-fix into cloud-init:master

 

Scott Moser has proposed merging ~smoser/cloud-init:fix/1792157-openstack-md-version-fix into cloud-init:master.

Commit message:
OpenStack: fix bug causing 'latest' version to be used from network.

Cloud-init was reading a list of versions from the OpenStack metadata
service (http://169.254.169.254/openstack/) and attempt to select the
newest known supported version.  The problem was that the list
of versions was not being decoded, so we were comparing a list of
bytes (found versions) to a list of strings (known versions).

LP: #1792157

Requested reviews:
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1792157 in cloud-init (Ubuntu): "cloud-init uses openstack latest version due to decoding bug"
  https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1792157

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

see commit message
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/1792157-openstack-md-version-fix into cloud-init:master.
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index 8f9c144..e3d372b 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -439,7 +439,7 @@ class MetadataReader(BaseReader):
             return self._versions
         found = []
         version_path = self._path_join(self.base_path, "openstack")
-        content = self._path_read(version_path)
+        content = self._path_read(version_path, decode=True)
         for line in content.splitlines():
             line = line.strip()
             if not line:

References