From 514534e6dbe17cd02bc3f241d4755263263da282 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 19 Feb 2018 21:18:00 +0000 Subject: [PATCH] Print image uuid instead of the whole dict After doing a commit, the CLI will print message like: Request to commit container XXX has been accepted. The image is {u'uuid': u'XXX'}. Instead of printing the whole image dict, simply print the uuid of the image will look better. Change-Id: I1c60b34e6bb30ee3c10d8ffebc97b7b16ec84e90 --- zunclient/osc/v1/containers.py | 2 +- zunclient/v1/containers_shell.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zunclient/osc/v1/containers.py b/zunclient/osc/v1/containers.py index 3db9b157..c4937320 100644 --- a/zunclient/osc/v1/containers.py +++ b/zunclient/osc/v1/containers.py @@ -993,7 +993,7 @@ class CommitContainer(command.Command): try: image = client.containers.commit(container, **opts) print("Request to commit container %s has been accepted. " - "The image is %s." % (container, image)) + "The image is %s." % (container, image['uuid'])) except Exception as e: print("commit container %(container)s failed: %(e)s" % {'container': container, 'e': e}) diff --git a/zunclient/v1/containers_shell.py b/zunclient/v1/containers_shell.py index 7e446e4d..afe399ad 100644 --- a/zunclient/v1/containers_shell.py +++ b/zunclient/v1/containers_shell.py @@ -714,7 +714,7 @@ def do_commit(cs, args): try: image = cs.containers.commit(args.container, **opts) print("Request to commit container %s has been accepted. " - "The image is %s." % (args.container, image)) + "The image is %s." % (args.container, image['uuid'])) except Exception as e: print("Commit for container %(container)s failed: %(e)s" % {'container': args.container, 'e': e})