summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-07-31 17:08:50 +0000
committerScott Moser <smoser@ubuntu.com>2015-07-31 17:08:50 +0000
commita0c8ba1c53e2834c0d9be8df9b514df0a631e09d (patch)
treefb8fa114876a2a2ccac3cc72e333da92d6e5fc3e /cloudinit
parent4f4e6d1cf90928daa1ab339f687b3319454aefdd (diff)
downloadvyos-cloud-init-a0c8ba1c53e2834c0d9be8df9b514df0a631e09d.tar.gz
vyos-cloud-init-a0c8ba1c53e2834c0d9be8df9b514df0a631e09d.zip
adjust searching so cache hits are logged
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/stages.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 82197d02..79d22538 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -241,9 +241,16 @@ class Init(object):
def _get_data_source(self):
if self.datasource is not NULL_DATA_SOURCE:
return self.datasource
- ds = self._restore_from_cache()
- if ds:
- LOG.debug("Restored from cache, datasource: %s", ds)
+
+ with reporting.ReportStack(
+ name="check-cache", description="attempting to read from cache",
+ parent=self.reporter) as myrep:
+ ds = self._restore_from_cache()
+ if ds:
+ LOG.debug("Restored from cache, datasource: %s", ds)
+ myrep.description = "restored from cache"
+ else:
+ myrep.description = "no cache found"
if not ds:
(cfg_list, pkg_list) = self._get_datasources()
# Deep copy so that user-data handlers can not modify