From: Benoît Knecht Date: Tue, 17 Sep 2013 08:33:49 +0000 (+0200) Subject: Add --fs-type option to the 'disk' and 'osd' commands X-Git-Tag: v1.2.7~15^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4aeaa9099dd7712644043b036b7fb2244887619e;p=ceph-deploy.git Add --fs-type option to the 'disk' and 'osd' commands Signed-off-by: Benoît Knecht --- diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py index bfe0323..5d4a363 100644 --- a/ceph_deploy/osd.py +++ b/ceph_deploy/osd.py @@ -90,6 +90,7 @@ def prepare_disk( journal, activate_prepared_disk, zap, + fs_type, dmcrypt, dmcrypt_dir): """ @@ -100,6 +101,11 @@ def prepare_disk( ] if zap: args.append('--zap-disk') + if fs_type: + if fs_type not in ('btrfs', 'ext4', 'xfs'): + raise argparse.ArgumentTypeError( + "FS_TYPE must be one of 'btrfs', 'ext4' of 'xfs'") + args.extend(['--fs-type', fs_type]) if dmcrypt: args.append('--dmcrypt') if dmcrypt_dir is not None: @@ -224,6 +230,7 @@ def prepare(args, cfg, activate_prepared_disk): journal=journal, activate_prepared_disk=activate_prepared_disk, zap=args.zap_disk, + fs_type=args.fs_type, dmcrypt=args.dmcrypt, dmcrypt_dir=args.dmcrypt_key_dir, ) @@ -450,6 +457,12 @@ def make(parser): action='store_true', default=None, help='destroy existing partition table and content for DISK', ) + parser.add_argument( + '--fs-type', + metavar='FS_TYPE', + default='xfs', + help='filesystem to use to format DISK (xfs, btrfs or ext4)', + ) parser.add_argument( '--dmcrypt', action='store_true', default=None, @@ -494,6 +507,12 @@ def make_disk(parser): action='store_true', default=None, help='destroy existing partition table and content for DISK', ) + parser.add_argument( + '--fs-type', + metavar='FS_TYPE', + default='xfs', + help='filesystem to use to format DISK (xfs, btrfs or ext4)' + ) parser.add_argument( '--dmcrypt', action='store_true', default=None,