SAIO probe tests fail if /var/cache/swift* directories don't exist

Bug #1634745 reported by Shaun Murakami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
New
Undecided
Unassigned

Bug Description

recent changes in the probe tests, i.e. stop probe test if 'resetswift' script fails (perhaps this commit: https://review.openstack.org/gitweb?p=openstack/swift.git;a=commitdiff;h=95a5a4a7ec1ec8a48db756121e7b3440f5704536)

line 21 of resetswift (http://git.openstack.org/cgit/openstack/swift/tree/doc/saio/bin/resetswift) throws an error (exits with exit code 1) if the 'find' command fails to find any /var/cache/swift* directories.

As a fix, I propose wrapping it with an if statement:

if [ $(find /var/cache -type d -name "swift*" 2>/dev/null | wc -l ) != "0" ] ; then
    sudo find /var/cache/swift* -type f -name *.recon -exec rm -f {} \;
fi

In addition, assuming the script is being run as the swift user, 'sudo' should be used with the find command.

Revision history for this message
Shaun Murakami (stmuraka-ibm) 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.