Add missing flavor set --description option

The --description option was missing from the "loadbalancer flavor set"
command, the API allows it.

Story 2010462
Task 47005

Change-Id: Ic28f65db3f315add3c4953b1984c0cc1bda60023
This commit is contained in:
Gregory Thiemonge 2022-12-07 07:19:38 -05:00
parent 3a5429ab1a
commit 5f018bedd0
3 changed files with 15 additions and 2 deletions

View File

@ -201,6 +201,11 @@ class SetFlavor(command.Command):
metavar='<name>',
help="Set the name of the flavor."
)
parser.add_argument(
'--description',
metavar='<description>',
help="Set flavor description."
)
admin_group = parser.add_mutually_exclusive_group()
admin_group.add_argument(
'--enable',

View File

@ -157,10 +157,12 @@ class TestFlavorSet(TestFlavor):
self.cmd = flavor.SetFlavor(self.app, None)
def test_flavor_set(self):
arglist = [self._flavor.id, '--name', 'new_name']
arglist = [self._flavor.id, '--name', 'new_name',
'--description', 'new_desc']
verifylist = [
('flavor', self._flavor.id),
('name', 'new_name'),
('description', 'new_desc')
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@ -168,7 +170,8 @@ class TestFlavorSet(TestFlavor):
self.api_mock.flavor_set.assert_called_with(
self._flavor.id, json={
'flavor': {
'name': 'new_name'
'name': 'new_name',
'description': 'new_desc'
}})

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Added a missing option to the "loadbalancer flavor set" command, admins can
now update the description of an Octavia flavor.