File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -194,14 +194,25 @@ def _get_base_parser(add_help: bool = True) -> argparse.ArgumentParser:
194
194
required = False ,
195
195
default = os .getenv ("GITLAB_URL" ),
196
196
)
197
- parser .add_argument (
197
+
198
+ ssl_verify_group = parser .add_mutually_exclusive_group ()
199
+ ssl_verify_group .add_argument (
198
200
"--ssl-verify" ,
199
201
help = (
200
- "Whether SSL certificates should be validated. [env var: GITLAB_SSL_VERIFY]"
202
+ "Path to a CA_BUNDLE file or directory with certificates of trusted CAs. "
203
+ "[env var: GITLAB_SSL_VERIFY]"
201
204
),
202
205
required = False ,
203
206
default = os .getenv ("GITLAB_SSL_VERIFY" ),
204
207
)
208
+ ssl_verify_group .add_argument (
209
+ "--no-ssl-verify" ,
210
+ help = "Disable SSL verification" ,
211
+ required = False ,
212
+ dest = "ssl_verify" ,
213
+ action = "store_false" ,
214
+ )
215
+
205
216
parser .add_argument (
206
217
"--timeout" ,
207
218
help = (
Original file line number Diff line number Diff line change @@ -106,6 +106,13 @@ def test_base_parser():
106
106
assert args .verbose
107
107
assert args .gitlab == "gl_id"
108
108
assert args .config_file == ["foo.cfg" , "bar.cfg" ]
109
+ assert args .ssl_verify is None
110
+
111
+
112
+ def test_no_ssl_verify ():
113
+ parser = cli ._get_base_parser ()
114
+ args = parser .parse_args (["--no-ssl-verify" ])
115
+ assert args .ssl_verify is False
109
116
110
117
111
118
def test_v4_parse_args ():
You can’t perform that action at this time.
0 commit comments