diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-05-26 11:24:28 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-05-26 11:24:28 -0400 |
commit | ac851b8ff106abb4314d2b71f2a7dc194b259899 (patch) | |
tree | d273c818e99b4ed9da014cd7e2fb42be9d14570a | |
parent | b4a298b10c26ee79ee6f21a164cf32ab767ca14f (diff) | |
download | vyos-cloud-init-ac851b8ff106abb4314d2b71f2a7dc194b259899.tar.gz vyos-cloud-init-ac851b8ff106abb4314d2b71f2a7dc194b259899.zip |
fix usage of instance-id to instance_id in runpath, update cache on instancify
the fix for instance_id is clear and necessary.
making instancify write the cache is required for how we are having
the local datasource be relevant.
-rw-r--r-- | cloudinit/stages.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 35eddc3b..5141612f 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -222,7 +222,7 @@ class Init(object): if not ds: return (None, "no cache found") - run_iid_fn = self.paths.get_runpath('instance-id') + run_iid_fn = self.paths.get_runpath('instance_id') if os.path.exists(run_iid_fn): run_iid = util.load_file(run_iid_fn).strip() else: @@ -325,9 +325,11 @@ class Init(object): if not previous_iid: previous_iid = iid util.write_file(iid_fn, "%s\n" % iid) - util.write_file(self.paths.get_runpath('instance-id'), "%s\n" % iid) + util.write_file(self.paths.get_runpath('instance_id'), "%s\n" % iid) util.write_file(os.path.join(dp, 'previous-instance-id'), "%s\n" % (previous_iid)) + + self._write_to_cache() # Ensure needed components are regenerated # after change of instance which may cause # change of configuration @@ -363,8 +365,6 @@ class Init(object): reporter=self.reporter) def update(self): - if not self._write_to_cache(): - return self._store_userdata() self._store_vendordata() |