]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Modifies check of stale data by checking emptiness
authorIvo Jimenez <ivo.jimenez@gmail.com>
Wed, 2 Sep 2015 19:01:15 +0000 (12:01 -0700)
committerIvo Jimenez <ivo.jimenez@gmail.com>
Thu, 3 Sep 2015 08:17:28 +0000 (01:17 -0700)
Instead of checking whether the folder exists. If the folder exists and
it's empty, then it's OK.

teuthology/task/internal.py

index 1981810be340c9bb6efc57bf433c04e3c0b6433d..c95f1308121d3e152f8492286330fef25b471984 100644 (file)
@@ -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.')