← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~smoser/cloud-init/trunk.1592505 into lp:cloud-init

 

Scott Moser has proposed merging lp:~smoser/cloud-init/trunk.1592505 into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1592505 in cloud-init: "stack trace on reboot with NoCloud datasource on reboot"
  https://bugs.launchpad.net/cloud-init/+bug/1592505

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/trunk.1592505/+merge/297584
-- 
Your team cloud init development team is requested to review the proposed merge of lp:~smoser/cloud-init/trunk.1592505 into lp:cloud-init.
=== modified file 'cloudinit/sources/DataSourceNoCloud.py'
--- cloudinit/sources/DataSourceNoCloud.py	2016-05-25 21:05:09 +0000
+++ cloudinit/sources/DataSourceNoCloud.py	2016-06-16 01:18:44 +0000
@@ -24,7 +24,7 @@
 import os
 
 from cloudinit import log as logging
-from cloudinit import net
+from cloudinit.net import eni
 from cloudinit import sources
 from cloudinit import util
 
@@ -194,8 +194,7 @@
         # LP: #1568150 need getattr in the case that an old class object
         # has been loaded from a pickled file and now executing new source.
         dirs = getattr(self, 'seed_dirs', [self.seed_dir])
-        quick_id = _quick_read_instance_id(cmdline_id=self.cmdline_id,
-                                           dirs=dirs)
+        quick_id = _quick_read_instance_id(dirs=dirs)
         if not quick_id:
             return None
         return quick_id == current
@@ -203,20 +202,19 @@
     @property
     def network_config(self):
         if self._network_config is None:
-            if self.network_eni is not None:
-                self._network_config = net.convert_eni_data(self.network_eni)
+            if self._network_eni is not None:
+                self._network_config = eni.convert_eni_data(self._network_eni)
         return self._network_config
 
 
-def _quick_read_instance_id(cmdline_id, dirs=None):
+def _quick_read_instance_id(dirs=None):
     if dirs is None:
         dirs = []
 
     iid_key = 'instance-id'
-    if cmdline_id is None:
-        fill = {}
-        if parse_cmdline_data(cmdline_id, fill) and iid_key in fill:
-            return fill[iid_key]
+    fill = {}
+    if load_cmdline_data(fill) and iid_key in fill:
+        return fill[iid_key]
 
     for d in dirs:
         if d is None:


Follow ups