Conditions | 1 |
Total Lines | 44 |
Code Lines | 36 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | #!/usr/bin/python |
||
5 | def parse_args(): |
||
6 | parser = argparse.ArgumentParser() |
||
7 | |||
8 | parser.add_argument( |
||
9 | "--distro", |
||
10 | dest="distro", |
||
11 | default="fedora", |
||
12 | choices=("fedora", "centos7"), |
||
13 | help="What type of distribution to install" |
||
14 | ) |
||
15 | parser.add_argument( |
||
16 | "--domain", |
||
17 | dest="domain", |
||
18 | required=True, |
||
19 | help="What name should the new domain have." |
||
20 | ) |
||
21 | parser.add_argument( |
||
22 | "--disk-dir", |
||
23 | dest="disk_dir", |
||
24 | default="/var/lib/libvirt/images/", |
||
25 | help="Location of the VM qcow file." |
||
26 | ) |
||
27 | parser.add_argument( |
||
28 | "--ram", |
||
29 | dest="ram", |
||
30 | default=2048, |
||
31 | type=int, |
||
32 | help="Amount of RAM configured for the VM." |
||
33 | ) |
||
34 | parser.add_argument( |
||
35 | "--cpu", |
||
36 | dest="cpu", |
||
37 | default=2, |
||
38 | type=int, |
||
39 | help="Number of CPU cores configured for the VM." |
||
40 | ) |
||
41 | parser.add_argument( |
||
42 | "--dry", |
||
43 | dest="dry", |
||
44 | action="store_true", |
||
45 | help="Print command line instead of triggering command." |
||
46 | ) |
||
47 | |||
48 | return parser.parse_args() |
||
49 | |||
70 |