From: Sandon Van Ness Date: Wed, 12 Mar 2014 01:15:12 +0000 (-0700) Subject: Handle newer btrfstools. X-Git-Tag: 1.1.0~1591^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b455846d9ff2abab2412785172be7ae71ab546b3;p=teuthology.git Handle newer btrfstools. Newer btfs userland tools needs a -f like xfs instead of a prompt for yes. Trusty needs this change. Signed-off-by: Sandon Van Ness --- diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 0f8f45eb9..8a02770db 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -748,7 +748,17 @@ 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))) remote.run(