summaryrefslogtreecommitdiff
path: root/contrib/python/cmd/rm.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/rm.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/rm.py')
-rw-r--r--contrib/python/cmd/rm.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/contrib/python/cmd/rm.py b/contrib/python/cmd/rm.py
deleted file mode 100644
index c9dfaa688..000000000
--- a/contrib/python/cmd/rm.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from pman import PodmanRemote
-from utils import write_out, convert_size, stringTimeToHuman
-
-def cli(subparser):
- imagesp = subparser.add_parser("rm",
- help=("delete one or more containers"))
- imagesp.add_argument("--force", "-f", action="store_true", help="force delete", dest="force")
- imagesp.add_argument("delete_targets", nargs='*', help="container images to delete")
- imagesp.set_defaults(_class=Rm, func='remove_containers')
-
-
-class Rm(PodmanRemote):
-
- def remove_containers(self):
- delete_targets = getattr(self.args, "delete_targets")
- if len(delete_targets) < 1:
- raise ValueError("you must supply at least one container id or name to delete")
- force = getattr(self.args, "force")
- for d in delete_targets:
- con = self.client.containers.get(d)
- con.remove(force)
- write_out(con["id"])