Skip to content

Commit

Permalink
simplify make_started function in case a container is running, contai…
Browse files Browse the repository at this point in the history
…ner definition has not changed and restart is not true
  • Loading branch information
va1entin committed Aug 19, 2024
1 parent 4253bed commit e9bda01
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions plugins/module_utils/podman/podman_container_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1812,13 +1812,8 @@ def make_started(self):
self.container.name)
self.update_container_result()
return
elif self.container.running and not self.container.different:
if self.restart:
self.container.restart()
self.results['actions'].append('restarted %s' %
self.container.name)
self.update_container_result()
return
elif self.container.running and not self.container.different \
and not self.restart:
self.update_container_result(changed=False)
return
elif not self.container.exists:
Expand Down

0 comments on commit e9bda01

Please sign in to comment.