diff options
author | Fam Zheng <famz@redhat.com> | 2016-07-19 21:20:43 +0800 |
---|---|---|
committer | Fam Zheng <famz@redhat.com> | 2016-07-20 19:19:43 +0800 |
commit | 4b08af6019ab9c5cb78cb910a42d27a2d441f7fe (patch) | |
tree | be7a2d1ecb0213f77882f9124d2b2cac58d909ff /tests | |
parent | 1ad76b8af8b7e187cb34a685755ba60ce0ce1c40 (diff) |
docker: Add "images" subcommand to docker.py
This is a wrapper for the 'docker images' command.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1468934445-32183-9-git-send-email-famz@redhat.com
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/docker/docker.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 40bda9de7b..222a1053fe 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 <subcommand> ..." % os.path.basename(sys.argv[0])) |