Skip to content

Commit

Permalink
Simplify to just use opt in runner
Browse files Browse the repository at this point in the history
Simplify to just use opts in runner to get show_jid. Had thought
I'd need to do that so not to print when called via python api or
netapi, but doesn't seem to be an issue.
  • Loading branch information
barneysowood authored and Megan Wilhite committed Oct 17, 2023
1 parent fd0e3d2 commit 6c48871
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions salt/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ def run(self):
try:
if check_user(self.config["user"]):
pr = salt.utils.profile.activate_profile(profiling_enabled)
show_jid = self.config.get("show_jid", False)
try:
ret = runner.run(full_return=True, show_jid=show_jid)
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
Expand Down
4 changes: 2 additions & 2 deletions salt/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def print_docs(self):
print(docs[fun])

# TODO: move to mixin whenever we want a salt-wheel cli
def run(self, full_return=False, show_jid=False):
def run(self, full_return=False):
"""
Execute the runner sequence
"""
Expand Down Expand Up @@ -288,7 +288,7 @@ def run(self, full_return=False, show_jid=False):
return async_pub["jid"] # return the jid

# otherwise run it in the main process
if show_jid:
if self.opts.get("show_jid"):
print(f"jid: {self.jid}")

if self.opts.get("eauth"):
Expand Down

0 comments on commit 6c48871

Please sign in to comment.