cloud-init/cloud-init-0.6.2-runparts-emptydir.patch
2011-09-24 16:01:46 -07:00

15 lines
508 B
Diff

Index: cloud-init/cloudinit/util.py
===================================================================
--- cloud-init.orig/cloudinit/util.py
+++ cloud-init/cloudinit/util.py
@@ -133,7 +133,8 @@ def getkeybyid(keyid,keyserver):
def runparts(dirp, skip_no_exist=True):
if skip_no_exist and not os.path.isdir(dirp): return
-
+ if os.path.isdir(dirp) and os.listdir(dirp) == []: return
+
cmd = [ 'run-parts', '--regex', '.*', dirp ]
sp = subprocess.Popen(cmd)
sp.communicate()