Loading src/service/service/service_handlers/p4/p4_service_handler.py +13 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ def create_rule_del(endpoint_a, endpoint_b): ) def find_names(uuid_a, uuid_b, device_endpoints): endpoint_a, endpoint_b = None, None for endpoint in device_endpoints: if endpoint.endpoint_id.endpoint_uuid.uuid == uuid_a: endpoint_a = endpoint.name Loading Loading @@ -139,6 +140,12 @@ class P4ServiceHandler(_ServiceHandler): # Find names from uuids (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints) if endpoint_a is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) if endpoint_b is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) # One way rule = create_rule_set(endpoint_a, endpoint_b) Loading Loading @@ -203,6 +210,12 @@ class P4ServiceHandler(_ServiceHandler): # Find names from uuids (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints) if endpoint_a is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) if endpoint_b is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) # One way rule = create_rule_del(endpoint_a, endpoint_b) Loading src/tests/p4/tests/test_functional_bootstrap.py +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ def test_devices_bootstraping( link_uuid = link['link_id']['link_uuid']['uuid'] LOGGER.info('Adding Link {:s}'.format(link_uuid)) response = context_client.SetLink(Link(**link)) assert link_uuid == link_uuid assert response.name == link_uuid context_client.SetLink(Link(**link)) def test_devices_bootstrapped(context_client : ContextClient): # pylint: disable=redefined-outer-name Loading Loading
src/service/service/service_handlers/p4/p4_service_handler.py +13 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ def create_rule_del(endpoint_a, endpoint_b): ) def find_names(uuid_a, uuid_b, device_endpoints): endpoint_a, endpoint_b = None, None for endpoint in device_endpoints: if endpoint.endpoint_id.endpoint_uuid.uuid == uuid_a: endpoint_a = endpoint.name Loading Loading @@ -139,6 +140,12 @@ class P4ServiceHandler(_ServiceHandler): # Find names from uuids (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints) if endpoint_a is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) if endpoint_b is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) # One way rule = create_rule_set(endpoint_a, endpoint_b) Loading Loading @@ -203,6 +210,12 @@ class P4ServiceHandler(_ServiceHandler): # Find names from uuids (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints) if endpoint_a is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) if endpoint_b is None: LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) # One way rule = create_rule_del(endpoint_a, endpoint_b) Loading
src/tests/p4/tests/test_functional_bootstrap.py +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ def test_devices_bootstraping( link_uuid = link['link_id']['link_uuid']['uuid'] LOGGER.info('Adding Link {:s}'.format(link_uuid)) response = context_client.SetLink(Link(**link)) assert link_uuid == link_uuid assert response.name == link_uuid context_client.SetLink(Link(**link)) def test_devices_bootstrapped(context_client : ContextClient): # pylint: disable=redefined-outer-name Loading