fix the runner.run to have its own full_return that defautls to False so anything currently using runner.run will work the same as before. this is what i should have done from the start.

This commit is contained in:
Thomas Phipps 2023-06-26 19:11:54 +00:00 committed by Pedro Algarvio
parent 90b3c25364
commit 021c6792bf
3 changed files with 3 additions and 9 deletions

View file

@ -31,7 +31,7 @@ class SaltRun(salt.utils.parsers.SaltRunOptionParser):
if check_user(self.config["user"]):
pr = salt.utils.profile.activate_profile(profiling_enabled)
try:
ret = runner.run()
ret = runner.run(full_return=True)
# In older versions ret['data']['retcode'] was used
# for signaling the return code. This has been
# changed for the orchestrate runner, but external

View file

@ -207,7 +207,7 @@ class Runner(RunnerClient):
print(docs[fun])
# TODO: move to mixin whenever we want a salt-wheel cli
def run(self):
def run(self, full_return=False):
"""
Execute the runner sequence
"""
@ -306,7 +306,7 @@ class Runner(RunnerClient):
tag=async_pub["tag"],
jid=async_pub["jid"],
daemonize=False,
full_return=True,
full_return=full_return,
)
except salt.exceptions.SaltException as exc:
with salt.utils.event.get_event("master", opts=self.opts) as evt:

View file

@ -191,12 +191,6 @@ class ShellCase(TestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixin):
with RedirectStdStreams():
runner = salt.runner.Runner(opts)
ret["return"] = runner.run()
if (
isinstance(ret["return"], dict)
and "return" in ret["return"]
and "retcode" not in ret["return"]
):
ret["return"] = ret["return"]["return"]
try:
ret["jid"] = runner.jid
except AttributeError: