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

Check for successful ansible --version call #2949

Closed
wants to merge 1 commit into from

Conversation

Matoking
Copy link

@Matoking Matoking commented Nov 4, 2020

Check that the ansible --version command executes successfully or raise a subprocess.CalledProcessError. Otherwise , Ansible might print a message starting with "the full traceback was:" to stdout, eventually leading to the following cryptic exception:

packaging.version.InvalidVersion: Invalid version 'full'

With the check in place, the following exception is printed instead:

subprocess.CalledProcessError: Command ['ansible', '--version']' returned non-zero exit status 250.

PR Type

  • Bugfix Pull Request

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to update exception catch to include the new exception or it will endup with an ugly stack trace instead of the desired LOG.fatal execution path.

@ssbarnea ssbarnea added the bug label Nov 4, 2020
Check that the `ansible --version` command executes successfully or
raise a subprocess.CalledProcessError. Otherwise, Ansible might print a
message starting with "the full traceback was:" to stdout, eventually
leading to the following cryptic exception:

packaging.version.InvalidVersion: Invalid version 'full'

Signed-off-by: Janne Pulkkinen <janne.pulkkinen@protonmail.com>
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok but I cannot merge due to the linting issue which is unrelated. I will fix it later and merge your patch.

And thank you!

@ssbarnea
Copy link
Member

ssbarnea commented Nov 8, 2020

Obsoleted byt #2956

@ssbarnea ssbarnea closed this Nov 8, 2020
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.

2 participants