Fix typo on error handling
Change-Id: I8fadd4205630da64b8e561ac369a09530d8a4133
This commit is contained in:
parent
5ba2f40262
commit
67d16f3009
@ -226,10 +226,10 @@ class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend):
|
||||
'bgp_as': int(
|
||||
port.external_ids[constants.OVN_EVPN_AS_EXT_ID_KEY])}
|
||||
except (KeyError, ValueError):
|
||||
LOG.error('Either "%s" or "%s" were not found or have an '
|
||||
LOG.debug('Either "%s" or "%s" were not found or have an '
|
||||
'invalid value in the port %s '
|
||||
'external_ids %s', constants.OVN_EVPN_VNI_EXT_ID_KEY,
|
||||
constants.OVN_EVPN_AS_EXT_ID_KEY, port.name,
|
||||
constants.OVN_EVPN_AS_EXT_ID_KEY, port.logical_port,
|
||||
port.external_ids)
|
||||
return {}
|
||||
|
||||
|
@ -325,7 +325,7 @@ class TestOvsdbSbOvnIdl(test_base.TestCase):
|
||||
def _test_get_evpn_info(self, value_error=False):
|
||||
vni = 'invalid-vni' if value_error else '1001'
|
||||
port = fakes.create_object({
|
||||
'name': 'fake-port',
|
||||
'logical_port': 'fake-port',
|
||||
'external_ids': {constants.OVN_EVPN_VNI_EXT_ID_KEY: vni,
|
||||
constants.OVN_EVPN_AS_EXT_ID_KEY: '123'}})
|
||||
ret = self.sb_idl.get_evpn_info(port)
|
||||
@ -343,7 +343,8 @@ class TestOvsdbSbOvnIdl(test_base.TestCase):
|
||||
self._test_get_evpn_info(value_error=True)
|
||||
|
||||
def test_get_evpn_info_key_error(self):
|
||||
port = fakes.create_object({'name': 'fake-port', 'external_ids': {}})
|
||||
port = fakes.create_object({'logical_port': 'fake-port',
|
||||
'external_ids': {}})
|
||||
ret = self.sb_idl.get_evpn_info(port)
|
||||
self.assertEqual({}, ret)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user