From bcc7d8f1138ea22207ac0d31c5be132d6f274b34 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Mon, 16 Apr 2018 10:30:32 -0400 Subject: [PATCH] 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 --- novaclient/v2/flavors.py | 3 ++- novaclient/v2/shell.py | 5 ++--- .../bug-1764420-flavor-delete-output-7b80f73deee5a869.yaml | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/bug-1764420-flavor-delete-output-7b80f73deee5a869.yaml diff --git a/novaclient/v2/flavors.py b/novaclient/v2/flavors.py index 89884bae1..f015a06e8 100644 --- a/novaclient/v2/flavors.py +++ b/novaclient/v2/flavors.py @@ -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)) diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index 28d4427d4..4801cfcf8 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -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( diff --git a/releasenotes/notes/bug-1764420-flavor-delete-output-7b80f73deee5a869.yaml b/releasenotes/notes/bug-1764420-flavor-delete-output-7b80f73deee5a869.yaml new file mode 100644 index 000000000..7d95eb391 --- /dev/null +++ b/releasenotes/notes/bug-1764420-flavor-delete-output-7b80f73deee5a869.yaml @@ -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.