This commit is contained in:
Alexandru Bleotu 2017-09-13 05:17:06 -04:00
parent 0222a5a056
commit 59cb07269c
2 changed files with 5 additions and 5 deletions

View File

@ -29,7 +29,7 @@ class EsxclusterProxySchema(Schema):
additional_properties = False additional_properties = False
proxytype = StringItem(required=True, proxytype = StringItem(required=True,
enum=['esxcluster']) enum=['esxcluster'])
vcenter = StringItem(required=True, pattern='[^\s]+') vcenter = StringItem(required=True, pattern=r'[^\s]+')
datacenter = StringItem(required=True) datacenter = StringItem(required=True)
cluster = StringItem(required=True) cluster = StringItem(required=True)
mechanism = StringItem(required=True, enum=['userpass', 'sspi']) mechanism = StringItem(required=True, enum=['userpass', 'sspi'])

View File

@ -159,7 +159,7 @@ import os
# Import Salt Libs # Import Salt Libs
import salt.exceptions import salt.exceptions
from salt.config.schemas.esxcluster import EsxclusterProxySchema from salt.config.schemas.esxcluster import EsxclusterProxySchema
from salt.utils.dictupdate import merge from salt.utils.dictupdate import merge
# This must be present or the Salt loader won't load this module. # This must be present or the Salt loader won't load this module.
@ -222,18 +222,18 @@ def init(opts):
raise salt.exceptions.InvalidConfigError( raise salt.exceptions.InvalidConfigError(
'Mechanism is set to \'userpass\', but no ' 'Mechanism is set to \'userpass\', but no '
'\'username\' key found in proxy config.') '\'username\' key found in proxy config.')
if not 'passwords' in proxy_conf: if 'passwords' not in proxy_conf:
raise salt.exceptions.InvalidConfigError( raise salt.exceptions.InvalidConfigError(
'Mechanism is set to \'userpass\', but no ' 'Mechanism is set to \'userpass\', but no '
'\'passwords\' key found in proxy config.') '\'passwords\' key found in proxy config.')
for key in ('username', 'passwords'): for key in ('username', 'passwords'):
DETAILS[key] = proxy_conf[key] DETAILS[key] = proxy_conf[key]
else: else:
if not 'domain' in proxy_conf: if 'domain' not in proxy_conf:
raise salt.exceptions.InvalidConfigError( raise salt.exceptions.InvalidConfigError(
'Mechanism is set to \'sspi\', but no ' 'Mechanism is set to \'sspi\', but no '
'\'domain\' key found in proxy config.') '\'domain\' key found in proxy config.')
if not 'principal' in proxy_conf: if 'principal' not in proxy_conf:
raise salt.exceptions.InvalidConfigError( raise salt.exceptions.InvalidConfigError(
'Mechanism is set to \'sspi\', but no ' 'Mechanism is set to \'sspi\', but no '
'\'principal\' key found in proxy config.') '\'principal\' key found in proxy config.')