blob: 4442324450dc0da41d8ebb7f7c5bcc43b974a6bd [file] [log] [blame]
Alexccb72e02021-01-20 16:38:03 -06001import os
2
3from cfg_checker.common.settings import pkg_dir
4
5_env_name = "local"
6_config_path = os.path.join(pkg_dir, 'etc', _env_name + '.env')
7
8
Alex9a4ad212020-10-01 18:04:25 -05009def add_global_arguments(parser):
10 parser.add_argument(
11 "-d",
12 "--debug",
13 action="store_true", default=False,
14 help="Set CLI logging level to DEBUG"
15 )
16 parser.add_argument(
Alex33747812021-04-07 10:11:39 -050017 "-k",
18 "--insecure",
19 action="store_true", default=False,
20 help="Use insecure way in SSL requests"
21 )
22 parser.add_argument(
Alex9a4ad212020-10-01 18:04:25 -050023 '-s',
24 '--sudo',
25 action='store_true', default=True,
26 help="Use sudo for getting salt creds"
27 )
28 parser.add_argument(
29 '--force-no-key',
30 action='store_true', default=False,
31 help="Use sudo for getting salt creds"
32 )
33 parser.add_argument(
34 '--skip-nodes',
35 metavar='skip_string', default=None,
36 help="String with nodes to skip. Only trailing '*' supported!"
37 " Example: 'cmp*,ctl01'"
38 )
39 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060040 '--kube-config',
41 metavar='kube_config', default="/root/.kube/config",
Alex9a4ad212020-10-01 18:04:25 -050042 help="Kube config path with certificates and keys. "
43 "Default: '/root/.kube/config'"
44 )
45 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060046 '--force-env-type',
47 metavar='force_env_type',
Alex9a4ad212020-10-01 18:04:25 -050048 help="Specify env to use if function supports multiple among detected"
49 " Example: SALT/KUBE"
50 )
Alexccb72e02021-01-20 16:38:03 -060051 parser.add_argument(
52 '--env-name',
53 metavar='env_name', default=_env_name,
54 help="Use of given env name instead of MCP_ENV var"
55 "Default: {}".format(_env_name)
56 )
57
58 parser.add_argument(
59 '--env-config',
60 metavar='env_config', default=_config_path,
61 help="Force use of given env file"
62 "Default: '{}'".format(_config_path)
63 )
Alex9a4ad212020-10-01 18:04:25 -050064
65 parser.add_argument(
66 '--skip-nodes-file',
67 metavar='skip_nodes_file', default=None,
68 help="Filename with nodes to skip. Note: use fqdn node names."
69 )