mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Allow for the default to specified for config.option
This commit is contained in:
parent
907e80b3a3
commit
be91049c71
@ -74,7 +74,7 @@ def valid_fileproto(uri):
|
||||
return False
|
||||
|
||||
|
||||
def option(value):
|
||||
def option(value, default=''):
|
||||
'''
|
||||
Pass in a generic option and recieve the value that will be assigned
|
||||
'''
|
||||
@ -86,7 +86,7 @@ def option(value):
|
||||
return __pillar__[value]
|
||||
elif value in defaults:
|
||||
return defaults[value]
|
||||
return ''
|
||||
return default
|
||||
|
||||
|
||||
def dot_vals(value):
|
||||
|
@ -101,8 +101,8 @@ def connect(**kwargs):
|
||||
if name in kwargs:
|
||||
connargs[key] = kwargs[name]
|
||||
else:
|
||||
val = __salt__['config.option']('mysql.{0}'.format(name))
|
||||
if val != '':
|
||||
val = __salt__['config.option']('mysql.{0}'.format(name), None)
|
||||
if val is not None:
|
||||
connargs[key] = val
|
||||
|
||||
_connarg('host')
|
||||
|
Loading…
Reference in New Issue
Block a user