1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-04-30 12:58:57 +00:00

Attempt graceful stop when recreating container (#203)

References: containers/ansible-podman-collections#202

Co-authored-by: Sergey <sshnaidm@users.noreply.github.com>
This commit is contained in:
Elias Norrby 2021-02-24 12:19:37 +01:00 committed by GitHub
parent 5b133ee898
commit 4da30fd3fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1389,11 +1389,15 @@ class PodmanContainer:
def recreate(self):
"""Recreate the container."""
if self.running:
self.stop()
self.delete()
self.create()
def recreate_run(self):
"""Recreate and run the container."""
if self.running:
self.stop()
self.delete()
self.run()