summaryrefslogtreecommitdiff
path: root/cloudinit/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2010-06-18 12:50:07 -0400
committerScott Moser <smoser@ubuntu.com>2010-06-18 12:50:07 -0400
commit6b0bb7b68c86ce8d0297cb1b2d2ee8eaa5427369 (patch)
treec5f0310a1a42eedd3ae8bbb6e6a17e671c5e7b26 /cloudinit/__init__.py
parent09d34f80736f336b9c556e930a8b910c8c9a341c (diff)
downloadvyos-cloud-init-6b0bb7b68c86ce8d0297cb1b2d2ee8eaa5427369.tar.gz
vyos-cloud-init-6b0bb7b68c86ce8d0297cb1b2d2ee8eaa5427369.zip
improve the cloud-init-run-module code a bit, fix LP:#568139
568139 was fixed because the test for "always" was using "is" instead of "==" LP: #568139
Diffstat (limited to 'cloudinit/__init__.py')
-rw-r--r--cloudinit/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py
index 04beca1e..624b8ee8 100644
--- a/cloudinit/__init__.py
+++ b/cloudinit/__init__.py
@@ -277,7 +277,7 @@ class CloudInit:
return("%s/%s.%s" % (semdir,name,freqtok))
def sem_has_run(self,name,freq):
- if freq is "always": return False
+ if freq == "always": return False
semfile = self.sem_getpath(name,freq)
if os.path.exists(semfile):
return True
@@ -293,7 +293,7 @@ class CloudInit:
if e.errno != errno.EEXIST:
raise e
- if os.path.exists(semfile) and freq is not "always":
+ if os.path.exists(semfile) and freq != "always":
return False
# race condition
@@ -325,7 +325,7 @@ class CloudInit:
return
try:
if not self.sem_acquire(semname,freq):
- raise Exception("Failed to acquire lock on %s\n" % semname)
+ raise Exception("Failed to acquire lock on %s" % semname)
func(*args)
except: