summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/sources/DataSourceAzure.py2
-rw-r--r--cloudinit/sources/DataSourceNoCloud.py3
-rw-r--r--cloudinit/sources/DataSourceOpenStack.py2
-rw-r--r--cloudinit/sources/__init__.py2
-rw-r--r--cloudinit/stages.py3
5 files changed, 7 insertions, 5 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 832b3063..698f4cac 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -254,7 +254,7 @@ class DataSourceAzureNet(sources.DataSource):
def get_config_obj(self):
return self.cfg
- def check_instance_id(self):
+ def check_instance_id(self, sys_cfg):
# quickly (local check only) if self.instance_id is still valid
return sources.instance_id_matches_system_uuid(self.get_instance_id())
diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py
index afd08935..f786516b 100644
--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -209,13 +209,14 @@ class DataSourceNoCloud(sources.DataSource):
mydata['meta-data']['dsmode'])
return False
- def check_instance_id(self):
+ def check_instance_id(self, sys_cfg):
# quickly (local check only) if self.instance_id is still valid
# we check kernel command line or files.
current = self.get_instance_id()
if not current:
return None
+ LOG.info("Hi, I got some system config: %s", sys_cfg)
quick_id = _quick_read_instance_id(cmdline_id=self.cmdline_id,
dirs=self.seed_dirs)
if not quick_id:
diff --git a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py
index 79bb9d63..f7f4590b 100644
--- a/cloudinit/sources/DataSourceOpenStack.py
+++ b/cloudinit/sources/DataSourceOpenStack.py
@@ -150,7 +150,7 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource):
return True
- def check_instance_id(self):
+ def check_instance_id(self, sys_cfg):
# quickly (local check only) if self.instance_id is still valid
return sources.instance_id_matches_system_uuid(self.get_instance_id())
diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py
index c63464b2..82cd3553 100644
--- a/cloudinit/sources/__init__.py
+++ b/cloudinit/sources/__init__.py
@@ -217,7 +217,7 @@ class DataSource(object):
def get_package_mirror_info(self):
return self.distro.get_package_mirror_info(data_source=self)
- def check_instance_id(self):
+ def check_instance_id(self, sys_cfg):
# quickly (local check only) if self.instance_id is still
return False
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 8ebbe6a9..5d6b0447 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -223,7 +223,8 @@ class Init(object):
if ds and existing == "trust":
myrep.description = "restored from cache: %s" % ds
elif ds and existing == "check":
- if hasattr(ds, 'check_instance_id') and ds.check_instance_id():
+ if (hasattr(ds, 'check_instance_id') and
+ ds.check_instance_id(self.cfg)):
myrep.description = "restored from checked cache: %s" % ds
else:
myrep.description = "cache invalid in datasource: %s" % ds