util.runparts should return gracefully when run on empty dirs

Bug #857926 reported by Garrett Holmstrom
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned

Bug Description

The way in which util.runparts calls the run-parts command makes scripts-per-once and friends fail unnecessarily when their scripts/* directories are empty. The attached patch makes the function simply return when called on an empty directory so modules do not fail in that case.

Related branches

Revision history for this message
Garrett Holmstrom (gholms) wrote :
Scott Moser (smoser)
Changed in cloud-init:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Scott Moser (smoser) wrote :

If you're seeing this, then I believe it must be a result of different behavior of 'run-parts' on Fedora than on ubuntu.
One might suggest that its just that Fedora's version of run-parts is broken. :)

Anyway, the patch is harmless enough and I'll pull it in.

Just for reference, on my Ubuntu laptop:

$ rm -Rf x; mkdir x; run-parts --regex '.*' x/ ; echo $?
0
$ dpkg -S `which run-parts`
debianutils: /bin/run-parts
$ dpkg-query --show debianutils
debianutils 4.0.2

Revision history for this message
Scott Moser (smoser) wrote :

Fixed in rev 462.

Changed in cloud-init:
status: Triaged → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.