summaryrefslogtreecommitdiff
path: root/contrib/python/podman/libs/images.py
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2018-07-10 12:12:59 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-12 01:38:30 +0000
commit86154b6538c1fec69fde14f2d4b35c31dcc10b35 (patch)
tree8c83e9dcd85da19cbf34ed894894a2dc4bdb1c9f /contrib/python/podman/libs/images.py
parent7f3f49139694e447a05522efce97d3f8516d0ea2 (diff)
downloadpodman-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/images.py')
-rw-r--r--contrib/python/podman/libs/images.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/contrib/python/podman/libs/images.py b/contrib/python/podman/libs/images.py
index 3beadec1d..334ff873c 100644
--- a/contrib/python/podman/libs/images.py
+++ b/contrib/python/podman/libs/images.py
@@ -3,6 +3,7 @@ import collections
import copy
import functools
import json
+import logging
from . import Config
from .containers import Container
@@ -37,11 +38,8 @@ class Image(collections.UserDict):
Pulls defaults from image.inspect()
"""
- with self._client() as podman:
- details = self.inspect()
+ details = self.inspect()
- # TODO: remove network settings once defaults implemented in service
- # Inialize config from parameters, then add image information
config = Config(image_id=self.id, **kwargs)
config['command'] = details.containerconfig['cmd']
config['env'] = self._split_token(details.containerconfig['env'])
@@ -49,8 +47,8 @@ class Image(collections.UserDict):
config['labels'] = copy.deepcopy(details.labels)
config['net_mode'] = 'bridge'
config['network'] = 'bridge'
- config['work_dir'] = '/tmp'
+ logging.debug('Image {}: create config: {}'.format(self.id, config))
with self._client() as podman:
id = podman.CreateContainer(config)['container']
cntr = podman.GetContainer(id)