summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceNoCloud.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-06-15 21:08:04 -0400
committerScott Moser <smoser@ubuntu.com>2016-06-15 21:08:04 -0400
commit4f989cc595775ab6b06fac604218d77910f3e4f4 (patch)
treea1a69e043c3d16cda77cbb4b18ebba51414f5db3 /cloudinit/sources/DataSourceNoCloud.py
parentd4e9f5d1a9afa5728094cb863dc0a9a0dc09dd04 (diff)
downloadvyos-cloud-init-4f989cc595775ab6b06fac604218d77910f3e4f4.tar.gz
vyos-cloud-init-4f989cc595775ab6b06fac604218d77910f3e4f4.zip
fis some Datasourcenocloud issues
LP: #1592505
Diffstat (limited to 'cloudinit/sources/DataSourceNoCloud.py')
-rw-r--r--cloudinit/sources/DataSourceNoCloud.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py
index 7e30118c..19d63950 100644
--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -24,7 +24,7 @@ import errno
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 @@ class DataSourceNoCloud(sources.DataSource):
# 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 @@ class DataSourceNoCloud(sources.DataSource):
@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: