blob: 387ed59905f5f7f92c7629824a4065be9351cf59 [file] [log] [blame]
Alex0989ecf2022-03-29 13:43:21 -05001# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
2# Copyright 2019-2022 Mirantis, Inc.
Alexccb72e02021-01-20 16:38:03 -06003import os
4
5from cfg_checker.common.settings import pkg_dir
6
7_env_name = "local"
8_config_path = os.path.join(pkg_dir, 'etc', _env_name + '.env')
9
10
Alex9a4ad212020-10-01 18:04:25 -050011def add_global_arguments(parser):
12 parser.add_argument(
13 "-d",
14 "--debug",
15 action="store_true", default=False,
16 help="Set CLI logging level to DEBUG"
17 )
18 parser.add_argument(
Alex33747812021-04-07 10:11:39 -050019 "-k",
20 "--insecure",
21 action="store_true", default=False,
22 help="Use insecure way in SSL requests"
23 )
24 parser.add_argument(
Alex9a4ad212020-10-01 18:04:25 -050025 '-s',
26 '--sudo',
27 action='store_true', default=True,
28 help="Use sudo for getting salt creds"
29 )
30 parser.add_argument(
Alexeffa0682021-06-04 12:18:33 -050031 '--ssh-direct',
32 action='store_true', default=False,
33 help="Force SSH to do direct connection instead of port forwarding"
34 )
35
36 parser.add_argument(
Alex9a4ad212020-10-01 18:04:25 -050037 '--force-no-key',
38 action='store_true', default=False,
Alexeffa0682021-06-04 12:18:33 -050039 help="Force SSH to login with no key"
Alex9a4ad212020-10-01 18:04:25 -050040 )
41 parser.add_argument(
42 '--skip-nodes',
43 metavar='skip_string', default=None,
44 help="String with nodes to skip. Only trailing '*' supported!"
45 " Example: 'cmp*,ctl01'"
46 )
47 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060048 '--kube-config',
49 metavar='kube_config', default="/root/.kube/config",
Alex9a4ad212020-10-01 18:04:25 -050050 help="Kube config path with certificates and keys. "
51 "Default: '/root/.kube/config'"
52 )
53 parser.add_argument(
Alexccb72e02021-01-20 16:38:03 -060054 '--force-env-type',
55 metavar='force_env_type',
Alex9a4ad212020-10-01 18:04:25 -050056 help="Specify env to use if function supports multiple among detected"
57 " Example: SALT/KUBE"
58 )
Alexccb72e02021-01-20 16:38:03 -060059 parser.add_argument(
60 '--env-name',
61 metavar='env_name', default=_env_name,
62 help="Use of given env name instead of MCP_ENV var"
63 "Default: {}".format(_env_name)
64 )
65
66 parser.add_argument(
67 '--env-config',
68 metavar='env_config', default=_config_path,
69 help="Force use of given env file"
70 "Default: '{}'".format(_config_path)
71 )
Alex9a4ad212020-10-01 18:04:25 -050072
73 parser.add_argument(
74 '--skip-nodes-file',
75 metavar='skip_nodes_file', default=None,
76 help="Filename with nodes to skip. Note: use fqdn node names."
77 )