Joshua Harlow has proposed merging lp:~harlowja/cloud-init/vd-helper-layer into 
lp:cloud-init.

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

For more details, see:
https://code.launchpad.net/~harlowja/cloud-init/vd-helper-layer/+merge/208948

Do the vendor data namespace in the openstack helper

Since both the config drive datasource and the openstack
datasource expose the vendor data attribute make sure that
we do the namespacing in the underlying helper layer instead
of the datasource layer.

-- 
https://code.launchpad.net/~harlowja/cloud-init/vd-helper-layer/+merge/208948
Your team cloud init development team is requested to review the proposed merge 
of lp:~harlowja/cloud-init/vd-helper-layer into lp:cloud-init.
=== modified file 'cloudinit/sources/DataSourceOpenStack.py'
--- cloudinit/sources/DataSourceOpenStack.py	2014-02-24 22:41:42 +0000
+++ cloudinit/sources/DataSourceOpenStack.py	2014-03-02 01:20:37 +0000
@@ -142,15 +142,7 @@
         self.userdata_raw = results.get('userdata')
         self.version = results['version']
         self.files.update(results.get('files', {}))
-
-        # if vendordata includes 'cloud-init', then read that explicitly
-        # for cloud-init (for namespacing).
-        vd = results.get('vendordata')
-        if isinstance(vd, dict) and 'cloud-init' in vd:
-            self.vendordata_raw = vd['cloud-init']
-        else:
-            self.vendordata_raw = vd
-
+        self.vendordata_raw = results.get('vendordata')
         return True
 
 

=== modified file 'cloudinit/sources/helpers/openstack.py'
--- cloudinit/sources/helpers/openstack.py	2014-02-24 22:41:42 +0000
+++ cloudinit/sources/helpers/openstack.py	2014-03-02 01:20:37 +0000
@@ -196,6 +196,14 @@
         If not a valid location, raise a NonReadable exception.
         """
 
+        def vendor_translator(data):
+            # If vendordata includes 'cloud-init', then read that explicitly
+            # for cloud-init (for namespacing).
+            vd = util.load_json(data)
+            if isinstance(vd, dict) and 'cloud-init' in vd:
+                vd = vd['cloud-init']
+            return vd
+
         def datafiles(version):
             files = {}
             files['metadata'] = (
@@ -214,7 +222,7 @@
             files['vendordata'] = (
                 self._path_join("openstack", version, 'vendor_data.json'),
                 False,
-                util.load_json,
+                vendor_translator,
             )
             return files
 

_______________________________________________
Mailing list: https://launchpad.net/~cloud-init-dev
Post to     : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to