← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~harlowja/cloud-init/ds-os-adjust into lp:cloud-init

 

Joshua Harlow has proposed merging lp:~harlowja/cloud-init/ds-os-adjust into lp:cloud-init.

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

For more details, see:
https://code.launchpad.net/~harlowja/cloud-init/ds-os-adjust/+merge/208031
-- 
https://code.launchpad.net/~harlowja/cloud-init/ds-os-adjust/+merge/208031
Your team cloud init development team is requested to review the proposed merge of lp:~harlowja/cloud-init/ds-os-adjust into lp:cloud-init.
=== modified file 'cloudinit/sources/DataSourceOpenStack.py'
--- cloudinit/sources/DataSourceOpenStack.py	2014-02-14 19:24:06 +0000
+++ cloudinit/sources/DataSourceOpenStack.py	2014-02-24 22:43:13 +0000
@@ -88,11 +88,11 @@
         md_urls = []
         url2base = {}
         for url in urls:
-            md_url = url_helper.combine_url(url, 'openstack',
-                                            openstack.OS_LATEST,
-                                            'meta_data.json')
-            md_urls.append(md_url)
-            url2base[md_url] = url
+            for version in openstack.OS_VERSIONS + (openstack.OS_LATEST,):
+                md_url = url_helper.combine_url(url, 'openstack',
+                                                version, 'meta_data.json')
+                md_urls.append(md_url)
+                url2base[md_url] = url
 
         (max_wait, timeout) = self._get_url_settings()
         start_time = time.time()
@@ -120,7 +120,7 @@
                                     read_metadata_service,
                                     args=[self.metadata_address],
                                     kwargs={'ssl_details': self.ssl_details,
-                                            'version': openstack.OS_LATEST})
+                                            'version': openstack.OS_HAVANA})
         except openstack.NonReadable:
             return False
         except (openstack.BrokenMetadata, IOError):

=== modified file 'cloudinit/sources/helpers/openstack.py'
--- cloudinit/sources/helpers/openstack.py	2014-02-09 01:29:52 +0000
+++ cloudinit/sources/helpers/openstack.py	2014-02-24 22:43:13 +0000
@@ -44,12 +44,15 @@
     ('local-hostname', 'hostname', False),
     ('instance-id', 'uuid', True),
 )
+OS_LATEST = 'latest'
+OS_FOLSOM = '2012-08-10'
+OS_GRIZZLY = '2013-04-04'
+OS_HAVANA = '2013-10-17'
 OS_VERSIONS = (
-    '2012-08-10',  # folsom
-    '2013-04-04',  # grizzly
-    '2013-10-17',  # havana
+    OS_FOLSOM,
+    OS_GRIZZLY,
+    OS_HAVANA,
 )
-OS_LATEST = 'latest'
 
 
 class NonReadable(IOError):
@@ -176,12 +179,12 @@
                                    potential_version)
             if self._path_exists(path):
                 if potential_version != version:
-                    LOG.warn("Version '%s' not available, attempting to use"
-                             " version '%s' instead", version,
-                             potential_version)
+                    LOG.debug("Version '%s' not available, attempting to use"
+                              " version '%s' instead", version,
+                              potential_version)
                 return potential_version
-        LOG.warn("Version '%s' not available, attempting to use '%s'"
-                 " instead", version, OS_LATEST)
+        LOG.debug("Version '%s' not available, attempting to use '%s'"
+                  " instead", version, OS_LATEST)
         return OS_LATEST
 
     def read_v2(self, version=None):


Follow ups