summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/helpers.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py
index 794f00ec..2077401c 100644
--- a/cloudinit/helpers.py
+++ b/cloudinit/helpers.py
@@ -125,12 +125,23 @@ class FileSemaphores(object):
def has_run(self, name, freq):
if not freq or freq == PER_ALWAYS:
return False
- name = canon_sem_name(name)
- sem_file = self._get_path(name, freq)
+
+ cname = canon_sem_name(name)
+ sem_file = self._get_path(cname, freq)
# This isn't really a good atomic check
# but it suffices for where and when cloudinit runs
if os.path.exists(sem_file):
return True
+
+ # this case could happen if the migrator module hadn't run yet
+ # but the item had run before we did canon_sem_name.
+ if cname != name and os.path.exists(self._get_path(name, freq)):
+ LOG.warn("%s has run without canonicalized name [%s].\n"
+ "likely the migrator has not yet run. It will run next boot.\n"
+ "run manually with: cloud-init single --name=migrator"
+ % (name, cname))
+ return True
+
return False
def _get_path(self, name, freq):