validate return opt, remove default.

This commit is contained in:
David Boucha 2016-12-19 15:27:49 -07:00
parent 8bb37f9fe7
commit 9c248aa14c
2 changed files with 6 additions and 8 deletions

View file

@ -1093,8 +1093,6 @@ DEFAULT_MINION_OPTS = {
# ZMQ HWM for EventPublisher pub socket - different for minion vs. master
'event_publisher_pub_hwm': 1000,
'event_match_type': 'startswith',
# Default Minion returner
'return': '',
}
DEFAULT_MASTER_OPTS = {
@ -1549,6 +1547,11 @@ 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

@ -1451,17 +1451,12 @@ class Minion(MinionBase):
)
# 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']
if isinstance(opts.get('return'), list):
if data['ret']:
for item in opts['return']:
data['ret'] = ','.join((data['ret'], item))
else:
data['ret'] = ','.join(opts['return'])
# TODO: make a list? Seems odd to split it this late :/
if data['ret'] and isinstance(data['ret'], six.string_types):