8000 Avoid duplicate stdout on playbook failures by ssbarnea · Pull Request #2930 · ansible/molecule · GitHub
[go: up one dir, main page]

Skip to content

Avoid duplicate stdout on playbook failures - #2930

Merged
ssbarnea merged 1 commit into
masterfrom
fix/avoid-duplicate-output
Oct 30, 2020
Merged

ssbarnea merged 1 commit into
masterfrom
fix/avoid-duplicate-output

Conversation

@ssbarnea
@ssbarnea ssbarnea commented Oct 30, 2020 •
Copy link
Copy Markdown
Member

Newer run_command does print stdout/stderr, so there is no need to, print them again in case of failure. We now display the error code and the original command the produced it.

Example output:

$ molecule converge                                                                                               [12:55:46]
--> Found config file /Users/ssbarnea/c/a/molecule/.config/molecule/config.yml
--> Test matrix
---
default:
  - dependency
  - create
  - prepare
  - converge
--> Scenario: 'default'
--> Action: 'dependency'
Skipping, missing the requirements file.
Skipping, missing the requirements file.
--> Scenario: 'default'
--> Action: 'create'
Skipping, instances already created.
--> Scenario: 'default'
--> Action: 'prepare'
Skipping, prepare playbook not configured.
--> Scenario: 'default'
--> Action: 'converge'

PLAY [Converge] ****************************************************************

TASK [Gathering Facts] *********************************************************
fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: root@localhost: Permission denied (publickey,password,keyboard-interactive).", "unreachable": true}

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0

ERROR: Ansible return code was 4, command was ansible-playbook --inventory /Users/ssbarnea/.cache/molecule/molecule/default/inventory --skip-tags molecule-notest,notest /Users/ssbarnea/c/a/molecule/molecule/default/converge.yml
Time: 0h:00m:03s

Newer run_command does print stdout/stderr, so there is no need to,
print them again in case of failure. Instead we now display the
error code and the original command the produced it.
@ssbarnea
ssbarnea force-pushed the fix/avoid-duplicate-output branch from e59ca1c to 5e2e522 Compare October 30, 2020 13:25
@ssbarnea
ssbarnea merged commit 2a0f4ef into master Oct 30, 2020
@ssbarnea
ssbarnea deleted the fix/avoid-duplicate-output branch October 30, 2020 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0