Format the nodes list in openstack overcloud delete node

The current command will output something like the following:

  deleting nodes [u'UUID-UUID'] from stack overcloud

This change adds simple string formatting so that a raw Python list
isn't displayed.

Change-Id: Ibf8bc40f0c45be60e869c5ab3d99d892e24f8a94
Closes-Bug: #1633449
(cherry picked from commit 2cc4eef660)
This commit is contained in:
Dougal Matthews 2016-11-08 16:44:49 +00:00 committed by Julie Pichon
parent 2ed71e8e85
commit 0955bc5731
1 changed files with 3 additions and 2 deletions

View File

@ -66,8 +66,9 @@ class DeleteNode(command.Command):
self.log.debug("take_action(%s)" % parsed_args)
clients = self.app.client_manager
print("deleting nodes {0} from stack {1}".format(parsed_args.nodes,
parsed_args.stack))
nodes = '\n'.join('- %s' % node for node in parsed_args.nodes)
print("Deleting the following nodes from stack {stack}:\n{nodes}"
.format(stack=parsed_args.stack, nodes=nodes))
scale.scale_down(clients, parsed_args.stack, parsed_args.nodes)