Stop printing flavor details on successful flavor-delete

It's weird that the flavor-delete CLI would print out the
details of the flavor the user just deleted, rather than give
some confirmation message, or simply not print anything out
at all, which is arguably more expected behavior when deleting
a resource. This change simply removes the output on successful
deletion which brings "nova flavor-delete" more inline with other
delete CLIs, including "openstack flavor delete" behavior.

While in here, the variable and docstring code is updated to
reflect reality and a release note is added in case anyone was
ever relying on this odd behavior.

Change-Id: Ie3e07b45cc70213cde4e6077c604c9f2835c75ad
Closes-Bug: #1764420
This commit is contained in:
Matt Riedemann 2018-04-16 10:30:32 -04:00
parent 69d41135a0
commit bcc7d8f113
3 changed files with 9 additions and 4 deletions

View File

@ -155,7 +155,8 @@ class FlavorManager(base.ManagerWithFind):
def delete(self, flavor):
"""Delete a specific flavor.
:param flavor: The ID of the :class:`Flavor` to get.
:param flavor: Instance of :class:`Flavor` to delete or ID of the
flavor to delete.
:returns: An instance of novaclient.base.TupleWithMeta
"""
return self._delete("/flavors/%s" % base.getid(flavor))

View File

@ -1099,9 +1099,8 @@ def do_flavor_list(cs, args):
help=_("Name or ID of the flavor to delete."))
def do_flavor_delete(cs, args):
"""Delete a specific flavor"""
flavorid = _find_flavor(cs, args.flavor)
cs.flavors.delete(flavorid)
_print_flavor_list(cs, [flavorid])
flavor = _find_flavor(cs, args.flavor)
cs.flavors.delete(flavor)
@utils.arg(

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The ``flavor-delete`` command no longer prints out the details of the
deleted flavor. On successful deletion, there is no output.