From f5df30fd7737808c859986df56eb4a6e32dc189a Mon Sep 17 00:00:00 2001 From: Ivo Jimenez Date: Wed, 2 Sep 2015 12:01:15 -0700 Subject: [PATCH] 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. --- teuthology/task/internal.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 1981810be3..c95f130812 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.') -- 2.39.5