-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ansiblegate: take care of failed, skipped and unreachable tasks and propagate "retcode" #58214
Conversation
NO_PYTEST = not bool(pytest) | ||
|
||
|
||
@skipIf(NO_PYTEST, False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just cosmetic request to drop the redundant NO_PYTEST
constant. Other tests are using pytest
directly in skipIf
@skipIf(pytest is None, "PyTest is missing")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@meaksh thank you for contribution. Could you please follow up just one cosmetic change request? |
@DmitryKuzmenko I've pushed the changes you requested. Thanks for reviewing! 👍 |
assert ret == {"completed": True, "timeout": 1200} | ||
|
||
|
||
@patch("salt.utils.path.which", MagicMock(return_value=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please move this mock object into the function level scope. Having mocks in the module level scope could produce issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good to know, thanks! I've pushed the requested changes 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, I missed few of them. 1 sec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it should be ready now.
Looks good now. Thank you for update. |
@meaksh why are you marking all skipped tasks as outstanding? this behavior terminates the application of the state with an error |
Hey @denis-khalturin-incountry, I don't really get what you mean. Could you please elaborate that and provide some examples? Thanks in advance! |
@meaksh yes of course. i am applying playbook:
One of the tasks is skipped according to the conditions:
But if I start playbook by applying state, I get an error when executing playbook:
I think this is the wrong handling of skipped tasks |
Thanks for clarifying @denis-khalturin-incountry ! You're totally right 👍 I did some checks here and can confirm that Could you please create a new issue so we can hopefully produce a fix soon? Thanks in advance! |
Yes, I will create an issue. Thanks |
What does this PR do?
This PR fixes few issues on the
ansiblegate
execution and state modules when running playbooks:ansible.playbooks
to allow proper success/failed detection.ansible-playbook --check
in test mode (test=True
) to allow running playbooks that are using modules which does not allow--check
.What issues does this PR fix or reference?
Fixes: #57854
Fixes: #57855
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.