Cluster creation command returns complete cluster uuid

Cluster creation command shows complete uuid of the created
cluster.

Change-Id: I69ddbd706a5c6a06c5368db77c8e8d7445c46a11
Closes-bug: #1619543
This commit is contained in:
Rajiv Kumar
2016-09-02 11:44:23 +05:30
parent 2802587f39
commit 40dfdbb00b
2 changed files with 4 additions and 6 deletions

View File

@@ -119,9 +119,8 @@ def do_bay_create(cs, args):
if args.magnum_api_version and args.magnum_api_version == '1.1': if args.magnum_api_version and args.magnum_api_version == '1.1':
_show_bay(bay) _show_bay(bay)
else: else:
fields = str(bay).split("u'") uuid = str(bay._info['uuid'])
uuid = fields[2] print("Request to create bay %s has been accepted." % uuid)
print("Request to create bay %s has been accepted." % uuid[:-3])
except Exception as e: except Exception as e:
print("Create for bay %s failed: %s" % print("Create for bay %s failed: %s" %
(opts['name'], e)) (opts['name'], e))

View File

@@ -114,9 +114,8 @@ def do_cluster_create(cs, args):
if args.magnum_api_version and args.magnum_api_version == '1.1': if args.magnum_api_version and args.magnum_api_version == '1.1':
_show_cluster(cluster) _show_cluster(cluster)
else: else:
fields = str(cluster).split("u'") uuid = str(cluster._info['uuid'])
uuid = fields[2] print("Request to create cluster %s has been accepted." % uuid)
print("Request to create cluster %s has been accepted." % uuid[:3])
except Exception as e: except Exception as e:
print("Create for cluster %s failed: %s" % print("Create for cluster %s failed: %s" %
(opts['name'], e)) (opts['name'], e))