summaryrefslogtreecommitdiff
path: root/contrib/python/cmd/ps.py
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2018-06-27 21:37:42 -0700
committerJhon Honce <jhonce@redhat.com>2018-07-13 11:29:28 -0700
commit44b523c946c88e540b50d7ba59f441b5f8e0bad0 (patch)
tree744c09508b139c1aca3d7fc995fad7ff354e3667 /contrib/python/cmd/ps.py
parent14a6d51a8432fc0c3324fec02e8729d3032f2af2 (diff)
downloadpodman-44b523c946c88e540b50d7ba59f441b5f8e0bad0.tar.gz
podman-44b523c946c88e540b50d7ba59f441b5f8e0bad0.tar.bz2
podman-44b523c946c88e540b50d7ba59f441b5f8e0bad0.zip
remote python client for podman
* Use podman library for access * Verbose error checking * Planned windows and macosx ports Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'contrib/python/cmd/ps.py')
-rw-r--r--contrib/python/cmd/ps.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/contrib/python/cmd/ps.py b/contrib/python/cmd/ps.py
deleted file mode 100644
index 85db5489e..000000000
--- a/contrib/python/cmd/ps.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from pman import PodmanRemote
-from utils import write_out, convert_size, stringTimeToHuman
-
-def cli(subparser):
- imagesp = subparser.add_parser("ps",
- help=("list containers"))
- imagesp.add_argument("all", action="store_true", help="list all containers")
- imagesp.set_defaults(_class=Ps, func='display_all_containers')
-
-
-class Ps(PodmanRemote):
-
- def display_all_containers(self):
- col_fmt = "{0:15}{1:32}{2:22}{3:14}{4:12}{5:30}{6:20}"
- write_out(col_fmt.format("CONTAINER ID", "IMAGE", "COMMAND", "CREATED", "STATUS", "PORTS", "NAMES"))
-
- for i in self.client.containers.list():
- command = " ".join(i["command"])
- write_out(col_fmt.format(i["id"][0:12], i["image"][0:30], command[0:20], stringTimeToHuman(i["createdat"]), i["status"], "", i["names"][0:20]))