blob: 28f3a042836477a5795db8d64fc28a2c1ced5a47 [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(
Alexeffa0682021-06-04 12:18:33 -050029 '--ssh-direct',
30 action='store_true', default=False,
31 help="Force SSH to do direct connection instead of port forwarding"
32 )
33
34 parser.add_argument(
Alex9a4ad212020-10-01 18:04:25 -050035 '--force-no-key',
36 action='store_true', default=False,
Alexeffa0682021-06-04 12:18:33 -050037 help="Force SSH to login with no key"
Alex9a4ad212020-10-01 18:04:25 -050038 )
39 parser.add_argument(
40 '--skip-nodes',
41 metavar='skip_string', default=None,
42 help="String with nodes to skip. Only trailing '*' supported!"
43 " Example: 'cmp*,ctl01'"
44 )
45 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060046 '--kube-config',
47 metavar='kube_config', default="/root/.kube/config",
Alex9a4ad212020-10-01 18:04:25 -050048 help="Kube config path with certificates and keys. "
49 "Default: '/root/.kube/config'"
50 )
51 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060052 '--force-env-type',
53 metavar='force_env_type',
Alex9a4ad212020-10-01 18:04:25 -050054 help="Specify env to use if function supports multiple among detected"
55 " Example: SALT/KUBE"
56 )
Alexccb72e02021-01-20 16:38:03 -060057 parser.add_argument(
58 '--env-name',
59 metavar='env_name', default=_env_name,
60 help="Use of given env name instead of MCP_ENV var"
61 "Default: {}".format(_env_name)
62 )
63
64 parser.add_argument(
65 '--env-config',
66 metavar='env_config', default=_config_path,
67 help="Force use of given env file"
68 "Default: '{}'".format(_config_path)
69 )
Alex9a4ad212020-10-01 18:04:25 -050070
71 parser.add_argument(
72 '--skip-nodes-file',
73 metavar='skip_nodes_file', default=None,
74 help="Filename with nodes to skip. Note: use fqdn node names."
75 )