From: Alfredo Deza Date: Fri, 22 Nov 2013 16:57:16 +0000 (-0500) Subject: don't check for errors on first attempt to remove /var/lib/ceph X-Git-Tag: v1.3.3~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6e58eea7425c16aa30c19559e7c5b17498c1081;p=ceph-deploy.git don't check for errors on first attempt to remove /var/lib/ceph Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index ee4c5aa..1c29684 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -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, [