-
Notifications
You must be signed in to change notification settings - Fork 172
Prevent Failure on jid Not Defined #1157
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
Conversation
Confirmed fix:
|
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.
I'm not sure about that fix... I agree that the error should be clearer or more concise, but I don't think skipping it should be a good idea. The error is raised at the first task of the block:
# Creating Workflow Node
- name: add_workflows_schema | Create the Workflow Nodes
ansible.controller.workflow_job_template_node:
This is telling that something is wrong with the current node so... for the given workflow, it will be incomplete if we only skip that error.
I'd prefer to add a rescue section and to show the original error with the current node, making the playbook to fail instead of continuing ignoring the error.
@Tompage1994 @djdanielsson @sean-m-sullivan What do you think? |
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.
Looks good. I've just been through and checked that this logic isn't missing elsewhere and we seem to be fine
So, to me this is just implementing the same logic used in the rest of the collection. This was obviously missed before because it wasn't in a I think it is the right thing to be doing though as it's there to do cleanup of the async results files. The lack of a job id implies that there will be nothing to cleanup, therefore should appropriately be skipped. |
In my example, what happens is the last node has nothing to be connected to, so no async job to manage the links is created. Then, because no async job is created, there's no async job to cleanup, causing the failure without this added conditional. |
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.
LGTM
What does this PR do?
This PR prevents failure of async file cleanup when a jid file is not defined when setting up nodes in a controller workflow
How should this be tested?
Attempt to create a workflow:
Run simple playbook:
Without this commit, the playbook will fail:
This mirrors logic introduced in the main task file of the role.
Is there a relevant Issue open for this?
N/A
Other Relevant info, PRs, etc
N/A