Merge "[OVN] Use the Neutron port ID in `UpdateLSwitchPortQosOptionsCommand
`"
This commit is contained in:
commit
7e9529d277
@ -246,10 +246,13 @@ class UpdateLSwitchPortQosOptionsCommand(command.BaseCommand):
|
||||
self.qos = qos
|
||||
|
||||
def run_idl(self, txn):
|
||||
# NOTE(ralonsoh): this command can be called from inside a transaction
|
||||
# where the LSP is being created. If this is not the case, the value
|
||||
# provided in the Neutron port ID (== LSP.name).
|
||||
if isinstance(self.lport, command.BaseCommand):
|
||||
port_id = self.lport.result
|
||||
else:
|
||||
port_id = self.lport.uuid
|
||||
port_id = self.lport
|
||||
|
||||
try:
|
||||
port = self.api.lookup('Logical_Switch_Port', port_id)
|
||||
|
@ -263,7 +263,7 @@ class OVNClientQosExtension:
|
||||
the LSP.options. If the values are None, the keys
|
||||
are removed.
|
||||
"""
|
||||
lsp = lsp or self.nb_idl.lsp_get(port_id).execute()
|
||||
lsp = lsp or port_id
|
||||
if lsp:
|
||||
txn.add(self.nb_idl.update_lswitch_qos_options(lsp,
|
||||
**ovn_rule_lsp))
|
||||
|
@ -35,7 +35,7 @@ class GetPortQosTestCase(base.TestOVNFunctionalBase):
|
||||
else:
|
||||
options = {qos_param: None}
|
||||
lsp = self.nb_api.lsp_get(lsp_name).execute(check_error=True)
|
||||
self.nb_api.update_lswitch_qos_options(lsp, **options).execute(
|
||||
self.nb_api.update_lswitch_qos_options(lsp.uuid, **options).execute(
|
||||
check_error=True)
|
||||
if qos_value is not None:
|
||||
self.assertEqual(qos_value,
|
||||
|
@ -151,7 +151,7 @@ class QoSLogicalSwitchPortEventTestCase(base.TestOVNFunctionalBase):
|
||||
lsp = self.nb_api.lsp_get(port_id).execute(check_error=True)
|
||||
options = {ovn_const.LSP_OPTIONS_QOS_MAX_RATE: str(max_bps),
|
||||
ovn_const.LSP_OPTIONS_QOS_MIN_RATE: str(min_bps)}
|
||||
self.nb_api.update_lswitch_qos_options(lsp, **options).execute(
|
||||
self.nb_api.update_lswitch_qos_options(lsp.uuid, **options).execute(
|
||||
check_error=True)
|
||||
n_utils.wait_until_true(
|
||||
lambda: check_update_egress_called(max_kbps, min_kbps), timeout=5)
|
||||
|
Loading…
x
Reference in New Issue
Block a user