From: Ivo Jimenez Date: Wed, 2 Sep 2015 19:01:15 +0000 (-0700) Subject: Modifies check of stale data by checking emptiness X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f5df30fd7737808c859986df56eb4a6e32dc189a;p=teuthology.git Modifies check of stale data by checking emptiness Instead of checking whether the folder exists. If the folder exists and it's empty, then it's OK. --- diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 1981810be..c95f13081 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -367,7 +367,8 @@ def check_ceph_data(ctx, config): log.info('Checking for old /var/lib/ceph...') processes = ctx.cluster.run( - args=['test', '!', '-e', '/var/lib/ceph'], + args=['find', '/var/lib/ceph', '-maxdepth', '1', + run.Raw('|'), 'read', 'v'], wait=False, ) failed = False @@ -375,7 +376,9 @@ def check_ceph_data(ctx, config): try: proc.wait() except run.CommandFailedError: - log.error('Host %s has stale /var/lib/ceph, check lock and nuke/cleanup.', proc.remote.shortname) + log.error(('Host %s has stale /var/lib/ceph,' + ' check lock and nuke/cleanup.'), + proc.remote.shortname) failed = True if failed: raise RuntimeError('Stale /var/lib/ceph detected, aborting.')