fix/p4-driver for release 2

Change p4 driver to return None in actions (to be implemented in the future)

Change p4 driver to return None in endpoints

Change the device Tools.py script to check for None in endpoints

Merge request reports

Loading
+7 −1
Changes for src/device/service/drivers/p4/p4_driver.py: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ from .p4_common import matches_ipv4, matches_ipv6, valid_port,\
    P4_ATTR_DEV_P4BIN, P4_ATTR_DEV_P4INFO, P4_ATTR_DEV_TIMEOUT,\
    P4_VAL_DEF_VENDOR, P4_VAL_DEF_HW_VER, P4_VAL_DEF_SW_VER,\
    P4_VAL_DEF_TIMEOUT
from .p4_manager import P4Manager, KEY_TABLE,\
from .p4_manager import P4Manager, KEY_TABLE, KEY_ACTION, \
    KEY_ACTION_PROFILE, KEY_COUNTER, KEY_DIR_COUNTER, KEY_METER, KEY_DIR_METER,\
    KEY_CTL_PKT_METADATA
from .p4_client import WriteOperation
@@ -448,6 +448,12 @@ class P4Driver(_Driver):
                                ap_name)
                        if ap_entries:
                            entries.append(ap_entries)
                elif KEY_ACTION == resource_key:
                    #To be implemented or deprecated
                    pass
                elif '__endpoints__' == resource_key:
                    #Not Supported for P4 devices
                    pass
                elif KEY_CTL_PKT_METADATA == resource_key:
                    msg = f"{resource_key.capitalize()} is not a " \
                          f"retrievable resource"
+2 −0
Changes for src/device/service/Tools.py: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ def populate_endpoints(device : Device, driver : _Driver, monitoring_loops : Mon
        if isinstance(resource_value, Exception):
            errors.append(ERROR_GET.format(device_uuid, str(resource_key), str(resource_value)))
            continue
        if resource_value is None:
            continue

        endpoint_uuid = resource_value.get('uuid')

Loading