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