]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
don't check for errors on first attempt to remove /var/lib/ceph 139/head
authorAlfredo Deza <alfredo.deza@inktank.com>
Fri, 22 Nov 2013 16:57:16 +0000 (11:57 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Fri, 22 Nov 2013 16:57:16 +0000 (11:57 -0500)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/install.py

index ee4c5aa4e4c7de6a171be5f76147e13d07936ecf..1c296845d24b5378e3f1a4ac2c96070adb3cd873 100644 (file)
@@ -130,17 +130,31 @@ def purge_data(args):
 
     for hostname in args.host:
         distro = hosts.get(hostname, username=args.username)
-        LOG.info('Distro info: %s %s %s', distro.name, distro.release, distro.codename)
+        LOG.info(
+            'Distro info: %s %s %s',
+            distro.name,
+            distro.release,
+            distro.codename
+        )
+
         rlogger = logging.getLogger(hostname)
         rlogger.info('purging data on %s' % hostname)
 
-        process.run(
+        # Try to remove the contents of /var/lib/ceph first, don't worry
+        # about errors here, we deal with them later on
+        process.check(
             distro.conn,
             [
                 'rm', '-rf', '--one-file-system', '--', '/var/lib/ceph',
             ]
         )
+
+        # If we failed in the previous call, then we probably have OSDs
+        # still mounted, so we unmount them here
         if distro.conn.remote_module.path_exists('/var/lib/ceph'):
+            rlogger.warning(
+                'OSDs may still be mounted, trying to unmount them'
+            )
             process.run(
                 distro.conn,
                 [
@@ -151,6 +165,9 @@ def purge_data(args):
                     '-exec', 'umount', '{}', ';',
                 ]
             )
+
+            # And now we try again to remove the contents, since OSDs should be
+            # unmounted, but this time we do check for errors
             process.run(
                 distro.conn,
                 [