diff options
author | Jhon Honce <jhonce@redhat.com> | 2018-07-10 12:12:59 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-07-12 01:38:30 +0000 |
commit | 86154b6538c1fec69fde14f2d4b35c31dcc10b35 (patch) | |
tree | 8c83e9dcd85da19cbf34ed894894a2dc4bdb1c9f /contrib/python/podman/libs/containers.py | |
parent | 7f3f49139694e447a05522efce97d3f8516d0ea2 (diff) | |
download | podman-86154b6538c1fec69fde14f2d4b35c31dcc10b35.tar.gz podman-86154b6538c1fec69fde14f2d4b35c31dcc10b35.tar.bz2 podman-86154b6538c1fec69fde14f2d4b35c31dcc10b35.zip |
Refactor attach()/start() after podman changes
* Update examples
* Update/Clean up unittests
* Add Mixins for container attach()/start()
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Closes: #1080
Approved by: baude
Diffstat (limited to 'contrib/python/podman/libs/containers.py')
-rw-r--r-- | contrib/python/podman/libs/containers.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/contrib/python/podman/libs/containers.py b/contrib/python/podman/libs/containers.py index a350a128a..6dc2c141e 100644 --- a/contrib/python/podman/libs/containers.py +++ b/contrib/python/podman/libs/containers.py @@ -7,9 +7,10 @@ import signal import time from ._containers_attach import Mixin as AttachMixin +from ._containers_start import Mixin as StartMixin -class Container(collections.UserDict, AttachMixin): +class Container(AttachMixin, StartMixin, collections.UserDict): """Model for a container.""" def __init__(self, client, id, data): @@ -143,12 +144,6 @@ class Container(collections.UserDict, AttachMixin): message, pause) return results['image'] - def start(self): - """Start container, return container on success.""" - with self._client() as podman: - podman.StartContainer(self.id) - return self._refresh(podman) - def stop(self, timeout=25): """Stop container, return id on success.""" with self._client() as podman: |