From 4b08af6019ab9c5cb78cb910a42d27a2d441f7fe Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Tue, 19 Jul 2016 21:20:43 +0800 Subject: docker: Add "images" subcommand to docker.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a wrapper for the 'docker images' command. Signed-off-by: Fam Zheng Reviewed-by: Alex Bennée Message-id: 1468934445-32183-9-git-send-email-famz@redhat.com --- tests/docker/docker.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 40bda9d..222a105 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -179,6 +179,9 @@ class Docker(object): self._instances.remove(label) return ret + def command(self, cmd, argv, quiet): + return self._do([cmd] + argv, quiet=quiet) + class SubCommand(object): """A SubCommand template base class""" name = None # Subcommand name @@ -309,6 +312,12 @@ class CleanCommand(SubCommand): Docker().clean() return 0 +class ImagesCommand(SubCommand): + """Run "docker images" command""" + name = "images" + def run(self, args, argv): + return Docker().command("images", argv, args.quiet) + def main(): parser = argparse.ArgumentParser(description="A Docker helper", usage="%s ..." % os.path.basename(sys.argv[0])) -- cgit v1.1