From: Andrew Schoen Date: Thu, 2 Apr 2015 20:08:13 +0000 (-0500) Subject: Revert "ceph: be less weird about passing -f to mkfs" X-Git-Tag: v10.2.6~165^2^2~511^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8cb28ddb8ea1e2556bf89e807f9f7c03058e96a5;p=ceph.git Revert "ceph: be less weird about passing -f to mkfs" --- diff --git a/tasks/ceph.py b/tasks/ceph.py index fbe955dfc7d..6de47029169 100644 --- a/tasks/ceph.py +++ b/tasks/ceph.py @@ -529,8 +529,7 @@ def cluster(ctx, config): if mount_options is None: mount_options = ['noatime','user_subvol_rm_allowed'] if mkfs_options is None: - mkfs_options = ['-f', - '-m', 'single', + mkfs_options = ['-m', 'single', '-l', '32768', '-n', '32768'] if fs == 'xfs': @@ -558,7 +557,15 @@ def cluster(ctx, config): stdout=StringIO(), ) - remote.run(args= ['yes', run.Raw('|')] + ['sudo'] + mkfs + [dev]) + try: + remote.run(args= ['yes', run.Raw('|')] + ['sudo'] + mkfs + [dev]) + except run.CommandFailedError: + # Newer btfs-tools doesn't prompt for overwrite, use -f + if '-f' not in mount_options: + mkfs_options.append('-f') + mkfs = ['mkfs.%s' % fs] + mkfs_options + log.info('%s on %s on %s' % (mkfs, dev, remote)) + remote.run(args= ['yes', run.Raw('|')] + ['sudo'] + mkfs + [dev]) log.info('mount %s on %s -o %s' % (dev, remote, ','.join(mount_options)))