Skip to content

Display command output when command fails with batch + failhard options - #33050

Merged
cachedout merged 2 commits into
saltstack:2015.8from
rallytime:fix-32452
May 5, 2016
Merged

cachedout merged 2 commits into
saltstack:2015.8from
rallytime:fix-32452

Conversation

@rallytime

@rallytime rallytime commented May 4, 2016 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds the command output to the error response when a command fails and --failhard and --batch are used together.

What issues does this PR fix or reference?

Fixes #32452

Previous Behavior

When a cmd.run_all fails and --failhard is set with --batch, the batch run exits and displays an error. However, no information about the failure is presented:

root@rallytime:~# salt rallytime cmd.run_all 'foo' -b 1 --failhard

Executing run on ['rallytime']

ERROR: Minions returned with non-zero exit code.

New Behavior

Now, a data dictionary of the command output is displayed along with the ERROR message:

root@rallytime:~# salt rallytime cmd.run_all 'foo' -b 1 --failhard

Executing run on ['rallytime']

{'rallytime': {'retcode': 127, 'ret': {'pid': 5838, 'retcode': 127, 'stderr': '/bin/bash: foo: command not found', 'stdout': ''}}}
ERROR: Minions returned with non-zero exit code.

Tests written?

No

@cachedout
cachedout merged commit 2dbfa55 into saltstack:2015.8 May 5, 2016
@rallytime
rallytime deleted the fix-32452 branch May 5, 2016 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants