diff --git a/salt/modules/config.py b/salt/modules/config.py index e93292a47d..5215729b24 100644 --- a/salt/modules/config.py +++ b/salt/modules/config.py @@ -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): diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py index 469238ccbe..be93ea5b73 100644 --- a/salt/modules/mysql.py +++ b/salt/modules/mysql.py @@ -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')