[cloud-init/f16] Fix failures due to empty script dirs [LP:857926]

gholms gholms at fedoraproject.org
Sat Sep 24 23:10:17 UTC 2011


commit de68608047a865d701561c5850478dda900b337f
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Fri Sep 23 18:31:21 2011 -0700

    Fix failures due to empty script dirs [LP:857926]

 cloud-init-0.6.2-runparts-emptydir.patch |   14 ++++++++++++++
 cloud-init.spec                          |    4 ++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/cloud-init-0.6.2-runparts-emptydir.patch b/cloud-init-0.6.2-runparts-emptydir.patch
new file mode 100644
index 0000000..a6cf795
--- /dev/null
+++ b/cloud-init-0.6.2-runparts-emptydir.patch
@@ -0,0 +1,14 @@
+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()
diff --git a/cloud-init.spec b/cloud-init.spec
index a0f0b06..95f5cf3 100644
--- a/cloud-init.spec
+++ b/cloud-init.spec
@@ -35,6 +35,8 @@ Patch7:         cloud-init-0.6.2-puppetenable.patch
 Patch8:         cloud-init-0.6.2-sshkeytypes.patch
 # https://bugs.launchpad.net/cloud-init/+bug/857891
 Patch9:         cloud-init-0.6.2-fqdnargs.patch
+# https://bugs.launchpad.net/cloud-init/+bug/857926
+Patch10:        cloud-init-0.6.2-runparts-emptydir.patch
 
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -75,6 +77,7 @@ ssh keys and to let the user run various scripts.
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 cp -p %{SOURCE2} README.fedora
 
@@ -164,6 +167,7 @@ fi
 - Fixed a bad method call in FQDN-guessing [LP:857891]
 - Updated localefile patch
 - Disabled the grub_dpkg module
+- Fixed failures due to empty script dirs [LP:857926]
 
 * Fri Sep 23 2011 Garrett Holmstrom <gholms at fedoraproject.org> - 0.6.2-0.2.bzr450
 - Updated tzsysconfig patch


More information about the scm-commits mailing list