diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-09-10 15:03:54 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-09-10 15:03:54 -0400 |
commit | 67f198ceb6dfeb82b2d3f78955d21d09d43fa7db (patch) | |
tree | 3a80c0dd7c92ce0c3766ca19f6b035037ea4d4c0 /cloudinit/sources/helpers/openstack.py | |
parent | 91a5bf5fb67a147e2f434407d1449e745dc1ba3f (diff) | |
parent | 64f4a63c174a4f7c21e6e372927906099103d64c (diff) | |
download | vyos-cloud-init-67f198ceb6dfeb82b2d3f78955d21d09d43fa7db.tar.gz vyos-cloud-init-67f198ceb6dfeb82b2d3f78955d21d09d43fa7db.zip |
openstack: fix bug referencing undefined variable, revert some changes
I had leaked in a couple exception loud-ness changes previously.
This does fix one bug in that os_versions was not defined.
Diffstat (limited to 'cloudinit/sources/helpers/openstack.py')
-rw-r--r-- | cloudinit/sources/helpers/openstack.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py index 7b27621c..3c3de7e4 100644 --- a/cloudinit/sources/helpers/openstack.py +++ b/cloudinit/sources/helpers/openstack.py @@ -178,8 +178,10 @@ class BaseReader(object): break if selected_version != version: - LOG.debug("Version '%s' not available, attempting to use" - " version '%s' instead", version, selected_version) + LOG.warn("Version '%s' not available, attempting to use " + "version '%s' instead", version, selected_version) + else: + LOG.debug("Version '%s' was available.", version) return selected_version def _read_content_path(self, item): @@ -326,7 +328,7 @@ class ConfigDriveReader(BaseReader): path = self._path_join(self.base_path, 'openstack') found = [d for d in os.listdir(path) if os.path.isdir(os.path.join(path))] - self._versions = tuple(found) + self._versions = found return self._versions def _read_ec2_metadata(self): @@ -419,7 +421,7 @@ class MetadataReader(BaseReader): def _fetch_available_versions(self): # <baseurl>/openstack/ returns a newline separated list of versions if self._versions is not None: - return self.os_versions + return self._versions found = [] version_path = self._path_join(self.base_path, "openstack") content = self._path_read(version_path) @@ -428,7 +430,7 @@ class MetadataReader(BaseReader): if not line: continue found.append(line) - self._versions = tuple(found) + self._versions = found return self._versions |