mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Cosmetic: support bool value for 'ssl' config option.
This is useful for minion config which doesn't need anything to be set in ssl opts, but needs to enable it. In this case `ssl: True` looks better than `ssl: {}` in yaml config.
This commit is contained in:
parent
40f72db53e
commit
7a6fc11291
@ -932,7 +932,7 @@ VALID_OPTS = {
|
||||
# http://docs.python.org/2/library/ssl.html#ssl.wrap_socket
|
||||
# Note: to set enum arguments values like `cert_reqs` and `ssl_version` use constant names
|
||||
# without ssl module prefix: `CERT_REQUIRED` or `PROTOCOL_SSLv23`.
|
||||
'ssl': (dict, type(None)),
|
||||
'ssl': (dict, bool, type(None)),
|
||||
|
||||
# django auth
|
||||
'django_auth_path': str,
|
||||
@ -3106,7 +3106,11 @@ def _update_ssl_config(opts):
|
||||
'''
|
||||
Resolves string names to integer constant in ssl configuration.
|
||||
'''
|
||||
if opts['ssl'] is None:
|
||||
if opts['ssl'] in (None, False):
|
||||
opts['ssl'] = None
|
||||
return
|
||||
if opts['ssl'] is True:
|
||||
opts['ssl'] = {}
|
||||
return
|
||||
import ssl
|
||||
for key, prefix in (('cert_reqs', 'CERT_'),
|
||||
|
Loading…
Reference in New Issue
Block a user