Merge pull request #38221 from UtahDave/fix_default_returner

Fix default returner
This commit is contained in:
Mike Place 2016-12-20 13:34:35 -07:00 committed by GitHub
commit 2c3a39760a
3 changed files with 25 additions and 1 deletions

View file

@ -771,8 +771,16 @@
###### Returner settings ######
############################################
# Which returner(s) will be used for minion's result:
# Default Minion returners. Can be a comma delimited string or a list:
#
#return: mysql
#
#return: mysql,slack,redis
#
#return:
# - mysql
# - hipchat
# - slack
###### Miscellaneous settings ######

View file

@ -867,6 +867,9 @@ VALID_OPTS = {
# Extra modules for Salt Thin
'thin_extra_mods': str,
# Default returners minion should use. List or comma-delimited string
'return': (str, list),
}
# default configurations
@ -1544,6 +1547,10 @@ def _validate_opts(opts):
format_multi_opt(VALID_OPTS[key]))
)
# Convert list to comma-delimited string for 'return' config option
if isinstance(opts.get('return'), list):
opts['return'] = ','.join(opts['return'])
# RAET on Windows uses 'win32file.CreateMailslot()' for IPC. Due to this,
# sock_dirs must start with '\\.\mailslot\' and not contain any colons.
# We don't expect the user to know this, so we will fix up their path for

View file

@ -1449,6 +1449,15 @@ class Minion(MinionBase):
ret,
timeout=minion_instance._return_retry_timer()
)
# Add default returners from minion config
# Should have been coverted to comma-delimited string already
if isinstance(opts.get('return'), six.string_types):
if data['ret']:
data['ret'] = ','.join((data['ret'], opts['return']))
else:
data['ret'] = opts['return']
# TODO: make a list? Seems odd to split it this late :/
if data['ret'] and isinstance(data['ret'], six.string_types):
if 'ret_config' in data: