Repository navigation
Description
There are (I think) three global options around returners - return, return_config, and return_kwargs.
https://github.com/saltstack/salt/blob/master/doc/ref/cli/salt.rst
Only documents return.
https://github.com/saltstack/salt/blob/master/salt/utils/parsers.py
Documents return, return_config, and return_kwargs. However, the return_config is incorrectly a duplicate of return.
https://github.com/saltstack/salt/blob/master/doc/topics/jobs/index.rst#scheduler-with-returner
Only mentions returner, by example. Also mentions schedule_returner without further details.
https://github.com/saltstack/salt/blob/master/salt/modules/schedule.py
Does not document any of the above, but the code lists them in SCHEDULE_CONF.
https://github.com/saltstack/salt/blob/master/salt/states/schedule.py
Has an example with returner, return_config, and return_kwargs, but does not explain them. There's some implication that return_config refers to a named section somewhere.
https://github.com/saltstack/salt/blob/master/doc/ref/returners/index.rst
Only mentions return, by example.
https://github.com/saltstack/salt/blob/master/salt/returners/__init__.py
From looking at existing returners, get_returner_options appears to be how you are supposed to access the config and kwargs, but doesn't actually mention them. The documentation it does have appears to have multiple errors:
virtualname: the__virtual__()function often returns eitherTrue, or(False, msg), not the value of__virtualname__. This may be a wider problem of modules not implementing__virtual__()correctly.ret: the "if" / "if not" cases are identicalattrs: from reading the code this is actually supposed to be a dict, and it's unclear what the values are supposed to beprofile_attr: "the corresponding key of__salt__" doesn't make sense.__salt__is the API loader, not a config structureprofile_attrs: "... a value is read in the are used to fetch a value ..." - a chunk seems to be missing from the middle of this thoughtdefaults: isn't documented
In short, if you're trying to write or use a returner, it's almost impossible to find how these options are supposed to work.
I think the return_config and return_kwargs are actually passed to the returner function via ret["ret_config"] and ret["ret_kwargs"]?
Activity
OrangeDog commentedon May 5, 2022
Some things I've learned about
get_returner_options:attrsis a map from returned keys to config keys. The config keys are prefixed with{virtualname}., or with{ret["ret_config"]}.{virtualname}.ifret["ret_config"]is present.Defaults are applied according to the returned keys, and
ret["ret_kwargs"]are added regardless of listedattrs.return_configandreturn_kwargsfrom the CLI are indeed passed asret["ret_config"]andret["ret_kwargs"].This all relies on the returner having called
get_returner_optionscorrectly, and documenting theattrsit passed, especially if the keys and values are different.The slack, pushover, and xmpp returners use the
profile_*args, but it's not clear why.dwoz commentedon Oct 28, 2026
Closing — consolidated into #70585. The checkbox for this item is in the appropriate theme section of that tracker. Please pick up the sub-item there.