-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fix update_failure_action KeyError in docker_swarm_service #100
Fix update_failure_action KeyError in docker_swarm_service #100
Conversation
@@ -2551,7 +2551,9 @@ def _detect_update_config_failure_action_rollback(client): | |||
rollback_config_failure_action = ( | |||
(client.module.params['update_config'] or {}).get('failure_action') | |||
) | |||
update_failure_action = client.module.params['update_failure_action'] | |||
update_failure_action = ( | |||
client.module.params.get('update_failure_action') |
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 pretty sure that this is the wrong fix. A module option of this name no longer exists. I suspect we forgot to remove this part when removing some deprecated options.
It's probably best to remove this line and change the next two to
return rollback_config_failure_action == 'rollback'
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.
With the following suggestion and a changelog fragment, I think this would be ok.
c81332a
to
1ad7f48
Compare
changelogs/fragments/100-fix-update_failture_action-keyerror-in-docker_swarm_service.yaml
Outdated
Show resolved
Hide resolved
1ad7f48
to
27a97fc
Compare
Co-authored-by: Felix Fontein <[email protected]>
@sgpinkus thanks a lot for fixing this! |
SUMMARY
I get this error in
docker_swarm_service
module with python docker3.4.1
and docker 20:ISSUE TYPE
COMPONENT NAME
docker_swarm_service
ADDITIONAL INFORMATION
To reproduce the error in a playbook:
Where swarm-master is configure swarm master.
After change above exception goes away.