]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
1 | import argparse |
2 | from ceph_volume.util import arg_validators | |
3 | ||
4 | def create_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 | parser.add_argument( | |
15 | '--data', | |
16 | required=True, | |
17 | type=arg_validators.ValidDevice(as_string=True), | |
18 | help='a raw device to use for the OSD', | |
19 | ) | |
20 | parser.add_argument( | |
21 | '--bluestore', | |
22 | action='store_true', | |
23 | help='Use BlueStore backend') | |
24 | parser.add_argument( | |
25 | '--crush-device-class', | |
26 | dest='crush_device_class', | |
27 | help='Crush device class to assign this OSD to', | |
20effc67 | 28 | default="" |
92f5a8d4 | 29 | ) |
92f5a8d4 TL |
30 | parser.add_argument( |
31 | '--no-tmpfs', | |
32 | action='store_true', | |
33 | help='Do not use a tmpfs mount for OSD data dir' | |
34 | ) | |
35 | parser.add_argument( | |
36 | '--block.db', | |
37 | dest='block_db', | |
38 | help='Path to bluestore block.db block device' | |
39 | ) | |
40 | parser.add_argument( | |
41 | '--block.wal', | |
42 | dest='block_wal', | |
43 | help='Path to bluestore block.wal block device' | |
44 | ) | |
f6b5b4d7 TL |
45 | parser.add_argument( |
46 | '--dmcrypt', | |
47 | action='store_true', | |
48 | help='Enable device encryption via dm-crypt', | |
49 | ) | |
92f5a8d4 | 50 | return parser |