From ad246ddc9127529be449c108c0c201d515e5d441 Mon Sep 17 00:00:00 2001 From: Rajiv Kumar Date: Fri, 2 Sep 2016 11:44:23 +0530 Subject: [PATCH] Cluster creation command returns complete cluster uuid Cluster creation command shows complete uuid of the created cluster. Change-Id: I69ddbd706a5c6a06c5368db77c8e8d7445c46a11 Closes-bug: #1619543 (cherry picked from commit 40dfdbb00b7331db0753617a268e6a46534cfcc9) --- magnumclient/v1/bays_shell.py | 5 ++--- magnumclient/v1/clusters_shell.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/magnumclient/v1/bays_shell.py b/magnumclient/v1/bays_shell.py index 416d4e21..94ae574f 100644 --- a/magnumclient/v1/bays_shell.py +++ b/magnumclient/v1/bays_shell.py @@ -119,9 +119,8 @@ def do_bay_create(cs, args): if args.magnum_api_version and args.magnum_api_version == '1.1': _show_bay(bay) else: - fields = str(bay).split("u'") - uuid = fields[2] - print("Request to create bay %s has been accepted." % uuid[:-3]) + uuid = str(bay._info['uuid']) + print("Request to create bay %s has been accepted." % uuid) except Exception as e: print("Create for bay %s failed: %s" % (opts['name'], e)) diff --git a/magnumclient/v1/clusters_shell.py b/magnumclient/v1/clusters_shell.py index 66634e4f..7eae13db 100644 --- a/magnumclient/v1/clusters_shell.py +++ b/magnumclient/v1/clusters_shell.py @@ -114,9 +114,8 @@ def do_cluster_create(cs, args): if args.magnum_api_version and args.magnum_api_version == '1.1': _show_cluster(cluster) else: - fields = str(cluster).split("u'") - uuid = fields[2] - print("Request to create cluster %s has been accepted." % uuid[:3]) + uuid = str(cluster._info['uuid']) + print("Request to create cluster %s has been accepted." % uuid) except Exception as e: print("Create for cluster %s failed: %s" % (opts['name'], e))