Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid duplicate stdout on playbook failures #2930

Merged
merged 1 commit into from Oct 30, 2020

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Oct 30, 2020

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 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.

None yet

4 participants