From ac851b8ff106abb4314d2b71f2a7dc194b259899 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 26 May 2016 11:24:28 -0400 Subject: 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. --- cloudinit/stages.py | 8 ++++---- 1 file 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() -- cgit v1.2.3