blob: 9ccf2f7264d06e40f81339854106a2f402746964 [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(
17 '-s',
18 '--sudo',
19 action='store_true', default=True,
20 help="Use sudo for getting salt creds"
21 )
22 parser.add_argument(
23 '--force-no-key',
24 action='store_true', default=False,
25 help="Use sudo for getting salt creds"
26 )
27 parser.add_argument(
28 '--skip-nodes',
29 metavar='skip_string', default=None,
30 help="String with nodes to skip. Only trailing '*' supported!"
31 " Example: 'cmp*,ctl01'"
32 )
33 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060034 '--kube-config',
35 metavar='kube_config', default="/root/.kube/config",
Alex9a4ad212020-10-01 18:04:25 -050036 help="Kube config path with certificates and keys. "
37 "Default: '/root/.kube/config'"
38 )
39 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060040 '--force-env-type',
41 metavar='force_env_type',
Alex9a4ad212020-10-01 18:04:25 -050042 help="Specify env to use if function supports multiple among detected"
43 " Example: SALT/KUBE"
44 )
Alexccb72e02021-01-20 16:38:03 -060045 parser.add_argument(
46 '--env-name',
47 metavar='env_name', default=_env_name,
48 help="Use of given env name instead of MCP_ENV var"
49 "Default: {}".format(_env_name)
50 )
51
52 parser.add_argument(
53 '--env-config',
54 metavar='env_config', default=_config_path,
55 help="Force use of given env file"
56 "Default: '{}'".format(_config_path)
57 )
Alex9a4ad212020-10-01 18:04:25 -050058
59 parser.add_argument(
60 '--skip-nodes-file',
61 metavar='skip_nodes_file', default=None,
62 help="Filename with nodes to skip. Note: use fqdn node names."
63 )