summaryrefslogtreecommitdiff
path: root/contrib/python/pypodman
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/python/pypodman')
-rw-r--r--contrib/python/pypodman/pypodman/lib/podman_parser.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/python/pypodman/pypodman/lib/podman_parser.py b/contrib/python/pypodman/pypodman/lib/podman_parser.py
index 4150e5d50..a7c869a98 100644
--- a/contrib/python/pypodman/pypodman/lib/podman_parser.py
+++ b/contrib/python/pypodman/pypodman/lib/podman_parser.py
@@ -69,8 +69,8 @@ class PodmanArgumentParser(argparse.ArgumentParser):
self.add_argument(
'--username',
'-l',
- default=getpass.getuser(),
- help='Authenicating user on remote host. (default: %(default)s)')
+ help='Authenicating user on remote host. (default: {})'.format(
+ getpass.getuser()))
self.add_argument(
'--host', help='name of remote host. (default: None)')
self.add_argument(
@@ -175,6 +175,13 @@ class PodmanArgumentParser(argparse.ArgumentParser):
) # yapf:disable
reqattr(
+ 'port',
+ getattr(args, 'port')
+ or os.environ.get('PORT')
+ or config['default'].get('port', None)
+ ) # yapf:disable
+
+ reqattr(
'remote_socket_path',
getattr(args, 'remote_socket_path')
or os.environ.get('REMOTE_SOCKET_PATH')