Remove 'bgp speaker show dragents'

This has been deprecated for ages and generates an annoying warning when
building OSC docs. Time to cull it.

Change-Id: I76e4c7ab742d0bf27fecfda8fab41035618a4e24
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2023-05-17 13:03:51 +01:00
parent d342171f9e
commit 79c7de4630
5 changed files with 6 additions and 94 deletions

View File

@ -25,9 +25,6 @@ Network v2
.. autoprogram-cliff:: openstack.neutronclient.v2
:command: bgp speaker show
.. autoprogram-cliff:: openstack.neutronclient.v2
:command: bgp speaker show dragents
.. autoprogram-cliff:: openstack.neutronclient.v2
:command: bgp speaker add network

View File

@ -65,55 +65,6 @@ class RemoveBgpSpeakerFromDRAgent(command.Command):
speaker_id)
class ListDRAgentsHostingBgpSpeaker(command.Lister):
"""(Deprecated) List dynamic routing agents hosting a BGP speaker
(Use "bgp dragent list" instead)
"""
resource = 'agent'
list_columns = ['id', 'host', 'admin_state_up', 'alive']
unknown_parts_flag = False
def get_parser(self, prog_name):
self.log.warning("The 'openstack bgp speaker show dragents' CLI is "
"deprecated and will be removed in the future. Use "
"'openstack bgp dragent list' CLI instead.")
parser = super(ListDRAgentsHostingBgpSpeaker,
self).get_parser(prog_name)
parser.add_argument('bgp_speaker',
metavar='<bgp-speaker>',
help=_("List dynamic routing agents hosting a "
"BGP speaker (name or ID)"))
return parser
def take_action(self, parsed_args):
client = self.app.client_manager.network
speaker_id = client.find_bgp_speaker(parsed_args.bgp_speaker).id
data = client.get_bgp_dragents_hosting_speaker(speaker_id)
columns = (
'id',
'agent_type',
'host',
'availability_zone',
'is_alive',
'is_admin_state_up',
'binary'
)
column_headers = (
'ID',
'Agent Type',
'Host',
'Availability Zone',
'Alive',
'State',
'Binary'
)
return (column_headers,
(utils.get_item_properties(
s, columns,) for s in data))
class ListDRAgent(command.Lister):
"""List dynamic routing agents"""

View File

@ -82,44 +82,3 @@ class TestRemoveBgpSpeakerFromDRAgent(fakes.TestNeutronDynamicRoutingOSCV2):
assert_called_once_with(self._bgp_dragent_id,
self._bgp_speaker_id)
self.assertIsNone(result)
class TestListDRAgentsHostingBgpSpeaker(fakes.TestNeutronDynamicRoutingOSCV2):
_bgp_speaker = fakes.FakeBgpSpeaker.create_one_bgp_speaker()
_bgp_speaker_id = _bgp_speaker['id']
attrs = {'bgp_speaker_id': _bgp_speaker_id}
_bgp_dragents = fakes.FakeDRAgent.create_dragents(attrs)
columns = ('ID', 'Agent Type', 'Host', 'Availability Zone',
'Alive', 'State', 'Binary')
data = [(_bgp_dragent['id'],
_bgp_dragent['agent_type'],
_bgp_dragent['host'],
_bgp_dragent['availability_zone'],
_bgp_dragent['admin_state_up'],
_bgp_dragent['alive'],
_bgp_dragent['binary'],)
for _bgp_dragent in _bgp_dragents]
def setUp(self):
super(TestListDRAgentsHostingBgpSpeaker, self).setUp()
# Get the command object to test
self.cmd = bgp_dragent.ListDRAgent(self.app, self.namespace)
def test_list_dragents_hosting_bgp_speaker(self):
arglist = [
'--bgp-speaker', self._bgp_speaker_id,
]
verifylist = [
('bgp_speaker', self._bgp_speaker_id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
with mock.patch.object(self.networkclient,
"get_bgp_dragents_hosting_speaker",
return_value=self._bgp_dragents):
columns, data = self.cmd.take_action(parsed_args)
self.networkclient.get_bgp_dragents_hosting_speaker.\
assert_called_once_with(self._bgp_speaker_id)
self.assertEqual(self.columns, columns)
self.assertListEqual(self.data, list(data))

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The ``openstack bgp speaker show dragents`` CLI is removed. It was
deprecated in the 7.1.0 release (Ussuri). Use ``openstack bgp dragent list
--bgp-speaker <bgp-speaker>`` CLI instead.

View File

@ -76,7 +76,6 @@ openstack.neutronclient.v2 =
bgp_speaker_remove_peer = neutronclient.osc.v2.dynamic_routing.bgp_speaker:RemovePeerFromSpeaker
bgp_speaker_set = neutronclient.osc.v2.dynamic_routing.bgp_speaker:SetBgpSpeaker
bgp_speaker_show = neutronclient.osc.v2.dynamic_routing.bgp_speaker:ShowBgpSpeaker
bgp_speaker_show_dragents = neutronclient.osc.v2.dynamic_routing.bgp_dragent:ListDRAgentsHostingBgpSpeaker
firewall_group_create = neutronclient.osc.v2.fwaas.firewallgroup:CreateFirewallGroup
firewall_group_delete = neutronclient.osc.v2.fwaas.firewallgroup:DeleteFirewallGroup