Allow for the default to specified for config.option

This commit is contained in:
Evan Borgstrom 2012-11-12 14:37:04 -05:00
parent 907e80b3a3
commit be91049c71
2 changed files with 4 additions and 4 deletions

View File

@ -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):

View File

@ -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')