]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/devices/lvm/common.py
update sources to v12.1.3
[ceph.git] / ceph / src / ceph-volume / ceph_volume / devices / lvm / common.py
1 import argparse
2
3
4 def common_parser(prog, description):
5 """
6 Both prepare and create share the same parser, those are defined here to
7 avoid duplication
8 """
9 parser = argparse.ArgumentParser(
10 prog=prog,
11 formatter_class=argparse.RawDescriptionHelpFormatter,
12 description=description,
13 )
14 required_args = parser.add_argument_group('required arguments')
15 parser.add_argument(
16 '--journal',
17 help='A logical group name, path to a logical volume, or path to a device',
18 )
19 required_args.add_argument(
20 '--data',
21 required=True,
22 help='A logical group name or a path to a logical volume',
23 )
24 parser.add_argument(
25 '--journal-size',
26 default=5,
27 metavar='GB',
28 type=int,
29 help='Size (in GB) A logical group name or a path to a logical volume',
30 )
31 parser.add_argument(
32 '--bluestore',
33 action='store_true', default=False,
34 help='Use the bluestore objectstore (not currently supported)',
35 )
36 parser.add_argument(
37 '--filestore',
38 action='store_true', default=True,
39 help='Use the filestore objectstore (currently the only supported object store)',
40 )
41 parser.add_argument(
42 '--osd-id',
43 help='Reuse an existing OSD id',
44 )
45 parser.add_argument(
46 '--osd-fsid',
47 help='Reuse an existing OSD fsid',
48 )
49 # Do not parse args, so that consumers can do something before the args get
50 # parsed triggering argparse behavior
51 return parser
52
53
54 create_parser = common_parser # noqa
55 prepare_parser = common_parser # noqa