summaryrefslogtreecommitdiff
path: root/contrib/python/podman
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2018-11-16 14:54:07 -0700
committerJhon Honce <jhonce@redhat.com>2018-11-16 14:57:17 -0700
commit0d21b9001649320056fbbd665cfad515ea69fb99 (patch)
tree8b39530105e9c0eb2138434c68d2c76a9d8a8263 /contrib/python/podman
parentcd5742ff47f2650e1f33dd485485cd5027500955 (diff)
downloadpodman-0d21b9001649320056fbbd665cfad515ea69fb99.tar.gz
podman-0d21b9001649320056fbbd665cfad515ea69fb99.tar.bz2
podman-0d21b9001649320056fbbd665cfad515ea69fb99.zip
Implement pypodman start command
* Improve error messages from argparse Actions * Silence more pylint errors when supporting a given API * Refactor BooleanAction to support lower and mixed case input * Remove spurious print() Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'contrib/python/podman')
-rw-r--r--contrib/python/podman/podman/libs/_containers_attach.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/python/podman/podman/libs/_containers_attach.py b/contrib/python/podman/podman/libs/_containers_attach.py
index f2dad573b..94247d349 100644
--- a/contrib/python/podman/podman/libs/_containers_attach.py
+++ b/contrib/python/podman/podman/libs/_containers_attach.py
@@ -19,9 +19,13 @@ class Mixin:
"""
if stdin is None:
stdin = sys.stdin.fileno()
+ elif hasattr(stdin, 'fileno'):
+ stdin = stdin.fileno()
if stdout is None:
stdout = sys.stdout.fileno()
+ elif hasattr(stdout, 'fileno'):
+ stdout = stdout.fileno()
with self._client() as podman:
attach = podman.GetAttachSockets(self._id)
@@ -49,7 +53,7 @@ class Mixin:
def resize_handler(self):
"""Send the new window size to conmon."""
- def wrapped(signum, frame):
+ def wrapped(signum, frame): # pylint: disable=unused-argument
packed = fcntl.ioctl(self.pseudo_tty.stdout, termios.TIOCGWINSZ,
struct.pack('HHHH', 0, 0, 0, 0))
rows, cols, _, _ = struct.unpack('HHHH', packed)
@@ -67,7 +71,7 @@ class Mixin:
def log_handler(self):
"""Send command to reopen log to conmon."""
- def wrapped(signum, frame):
+ def wrapped(signum, frame): # pylint: disable=unused-argument
with open(self.pseudo_tty.control_socket, 'w') as skt:
# send conmon reopen log message
skt.write('2\n')