Clean up of docker swarm service (#45525)
* Remove redundant assignation of variable Found with https://lgtm.com/ * Fix check_mode when force_update is used
This commit is contained in:
parent
9cc9ca584a
commit
1be69cd69c
1 changed files with 5 additions and 8 deletions
|
@ -1069,7 +1069,6 @@ class DockerServiceManager():
|
|||
else:
|
||||
changed, changes, need_rebuild, force_update = new_service.compare(current_service)
|
||||
if changed:
|
||||
changed = True
|
||||
if need_rebuild:
|
||||
if not module.check_mode:
|
||||
self.remove_service(module.params['name'])
|
||||
|
@ -1077,7 +1076,6 @@ class DockerServiceManager():
|
|||
new_service)
|
||||
msg = 'Service rebuilt'
|
||||
rebuilt = True
|
||||
changes = changes
|
||||
else:
|
||||
if not module.check_mode:
|
||||
self.update_service(module.params['name'],
|
||||
|
@ -1085,16 +1083,15 @@ class DockerServiceManager():
|
|||
new_service)
|
||||
msg = 'Service updated'
|
||||
rebuilt = False
|
||||
changes = changes
|
||||
else:
|
||||
if force_update and not module.check_mode:
|
||||
self.update_service(module.params['name'],
|
||||
current_service,
|
||||
new_service)
|
||||
if force_update:
|
||||
if not module.check_mode:
|
||||
self.update_service(module.params['name'],
|
||||
current_service,
|
||||
new_service)
|
||||
msg = 'Service forcefully updated'
|
||||
rebuilt = False
|
||||
changed = True
|
||||
changes = changes
|
||||
else:
|
||||
msg = 'Service unchanged'
|
||||
facts = new_service.get_facts()
|
||||
|
|
Loading…
Reference in a new issue