From de68608047a865d701561c5850478dda900b337f Mon Sep 17 00:00:00 2001 From: Garrett Holmstrom Date: Fri, 23 Sep 2011 18:31:21 -0700 Subject: [PATCH] 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(+) create mode 100644 cloud-init-0.6.2-runparts-emptydir.patch 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 - 0.6.2-0.2.bzr450 - Updated tzsysconfig patch