@@ -331,6 +331,8 @@ default_options = {"hostname": "localhost",
331
331
"username" : "guest" ,
332
332
"password" : "guest" ,
333
333
"ssl" : False ,
334
+ "ssl_insecure" : False ,
335
+ "ssl_disable_hostname_verification" : False ,
334
336
"request_timeout" : 120 ,
335
337
"verbose" : True ,
336
338
"format" : "table" ,
@@ -393,9 +395,9 @@ def make_parser():
393
395
add ("--ssl-ca-cert-file" , dest = "ssl_ca_cert_file" ,
394
396
help = "PEM format CA certificate file for SSL" )
395
397
add ("--ssl-disable-hostname-verification" , dest = "ssl_disable_hostname_verification" ,
396
- help = "Disables peer hostname verification" , default = False , action = "store_true" )
398
+ help = "Disables peer hostname verification" , action = "store_true" )
397
399
add ("-k" , "--ssl-insecure" , dest = "ssl_insecure" ,
398
- help = "Disables all SSL validations like curl's '-k' argument" , default = False , action = "store_true" )
400
+ help = "Disables all SSL validations like curl's '-k' argument" , action = "store_true" )
399
401
add ("-t" , "--request-timeout" , dest = "request_timeout" ,
400
402
help = "HTTP request timeout in seconds" , type = "int" )
401
403
add ("-f" , "--format" , dest = "format" ,
@@ -470,13 +472,14 @@ def merge_config_file_options(cli_options, final_options):
470
472
assert_usage (False , msg )
471
473
else :
472
474
for key , section_val in section_settings .items ():
473
- # special case --ssl
474
- if key == 'ssl' :
475
+ # if CLI options contain this key, do not set it from the config file
476
+ if getattr (cli_options , key ) is not None :
477
+ continue
478
+ # special case for boolean values
479
+ if section_val == "True" or section_val == "False" :
475
480
setattr (final_options , key , section_val == "True" )
476
481
else :
477
- # if CLI options do not contain this key, set it from the config file
478
- if getattr (cli_options , key ) is None :
479
- setattr (final_options , key , section_val )
482
+ setattr (final_options , key , section_val )
480
483
return final_options
481
484
482
485
def expand_base_uri_options (cli_options , final_options ):
0 commit comments