|
3 | 3 | import argparse |
4 | 4 |
|
5 | 5 | arg_parser = argparse.ArgumentParser( |
6 | | - description="Checkout Git repos based on branch, tag, or commit id") |
| 6 | + description="Checkout Git repos based on branch, tag, or commit id" |
| 7 | +) |
7 | 8 |
|
8 | | -arg_parser.add_argument('--git-repo', help="Checkout the Git repo", |
9 | | - default="https://github.com/arvimal/Daisho") |
| 9 | +arg_parser.add_argument( |
| 10 | + "--git-repo", |
| 11 | + help="Checkout the Git repo", |
| 12 | + default="https://github.com/arvimal/Daisho", |
| 13 | +) |
10 | 14 |
|
11 | 15 | # First mutually exclusive group (Required) |
12 | 16 | group_one = arg_parser.add_mutually_exclusive_group(required=True) |
13 | 17 | group_one.add_argument( |
14 | | - '--git-tag', help='Fetch a git repo based on tag or branch', dest="da_tag") |
| 18 | + "--git-tag", help="Fetch a git repo based on tag or branch", dest="da_tag" |
| 19 | +) |
15 | 20 | group_one.add_argument( |
16 | | - '--git-commit', help="Checkout a git repo based on commit id", dest="da_commit") |
| 21 | + "--git-commit", help="Checkout a git repo based on commit id", dest="da_commit" |
| 22 | +) |
17 | 23 |
|
18 | 24 | # Second mutually exclusive group () |
19 | 25 | group_two = arg_parser.add_mutually_exclusive_group() |
20 | 26 | group_two.add_argument( |
21 | | - '--deploy-vm', help='Build a virtual machine, from a filesystem tarball available locally', nargs='?') |
| 27 | + "--deploy-vm", |
| 28 | + help="Build a virtual machine, from a filesystem tarball available locally", |
| 29 | + nargs="?", |
| 30 | +) |
22 | 31 | group_two.add_argument( |
23 | | - '--deploy-vm-remote', help='Build a virtual machine, from a tarball hosted on Artifactory', nargs='?') |
24 | | -group_two.add_argument('--delete-vm', help='Delete a deployed VM', nargs='?') |
| 32 | + "--deploy-vm-remote", |
| 33 | + help="Build a virtual machine, from a tarball hosted on Artifactory", |
| 34 | + nargs="?", |
| 35 | +) |
| 36 | +group_two.add_argument("--delete-vm", help="Delete a deployed VM", nargs="?") |
| 37 | +group_two.add_argument("--delete-vm-host", help="Delete a deployed VM", nargs="?") |
25 | 38 | group_two.add_argument( |
26 | | - '--delete-vm-host', help='Delete a deployed VM', nargs='?') |
| 39 | + "--upload", help="Upload the archive file to Artifactory", action="store_true" |
| 40 | +) |
27 | 41 | group_two.add_argument( |
28 | | - '--upload', help='Upload the archive file to Artifactory', action='store_true') |
29 | | -group_two.add_argument('--generate-test-rpm', |
30 | | - help='Build and upload the test rpm', action='store_true') |
| 42 | + "--generate-test-rpm", help="Build and upload the test rpm", action="store_true" |
| 43 | +) |
31 | 44 |
|
32 | 45 | # Optional arguments |
33 | 46 | arg_parser.add_argument( |
34 | | - '--verbose', help='Add verbosity to the ansible playbook execution', action='store_true') |
| 47 | + "--verbose", |
| 48 | + help="Add verbosity to the ansible playbook execution", |
| 49 | + action="store_true", |
| 50 | +) |
35 | 51 | arg_parser.add_argument( |
36 | | - '--debug', help='Do not skip tasks tagged with "debug"', action='store_true') |
| 52 | + "--debug", help='Do not skip tasks tagged with "debug"', action="store_true" |
| 53 | +) |
37 | 54 | arg_parser.add_argument( |
38 | | - '--pause', help='Do not skip tasks tagged with "pause"', action='store_true') |
| 55 | + "--pause", help='Do not skip tasks tagged with "pause"', action="store_true" |
| 56 | +) |
39 | 57 | arg_parser.add_argument( |
40 | | - '--cleanup', help='Only run tasks tagged with "cleanup"', action='store_true') |
| 58 | + "--cleanup", help='Only run tasks tagged with "cleanup"', action="store_true" |
| 59 | +) |
41 | 60 | arg_parser.add_argument( |
42 | | - '--tags', help='Space separated list of tags to run', nargs='+', default=[]) |
| 61 | + "--tags", help="Space separated list of tags to run", nargs="+", default=[] |
| 62 | +) |
43 | 63 | arg_parser.add_argument( |
44 | | - '--skip-tags', help='Space separated list of tags to skip', nargs='+', default=[]) |
| 64 | + "--skip-tags", help="Space separated list of tags to skip", nargs="+", default=[] |
| 65 | +) |
45 | 66 | arg_parser.add_argument( |
46 | | - '--build-id', help='Add a build ID to the archive when triggered by a build system', required=True, nargs='?') |
| 67 | + "--build-id", |
| 68 | + help="Add a build ID to the archive when triggered by a build system", |
| 69 | + required=True, |
| 70 | + nargs="?", |
| 71 | +) |
47 | 72 |
|
48 | 73 |
|
49 | 74 | arguments = arg_parser.parse_args() |
|
0 commit comments