Commit df5542d3 authored by Georgios P. Katsikas's avatar Georgios P. Katsikas
Browse files

fix: naming and logging in fabric-tna test

parent 0db5993e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ def split_links_by_type(links : List[Dict]) -> Dict[str, List[Dict]]:
            raise Exception(MSG.format(str(link)))

        link_type = LinkTypeEnum.Value(str_link_type)
        if link_type in {LinkTypeEnum.LINKTYPE_UNKNOWN, LinkTypeEnum.LINKTYPE_COPPER, LinkTypeEnum.LINKTYPE_RADIO}:
        if link_type in {LinkTypeEnum.LINKTYPE_UNKNOWN, LinkTypeEnum.LINKTYPE_COPPER, LinkTypeEnum.LINKTYPE_RADIO, LinkTypeEnum.LINKTYPE_MANAGEMENT}:
            typed_links['normal'].append(link)
        elif link_type in {LinkTypeEnum.LINKTYPE_FIBER}:
            typed_links['optical'].append(link)
+7 −5
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ class P4FabricACLServiceHandler(_ServiceHandler):
            # You should no longer visit this device port again
            visited.add(dev_port_key)

            if applied_rules > 0:
                LOGGER.info("Installed {}/{} ACL rules on device {} and port {}".format(
                    applied_rules, actual_rules, device_name, port_id))

@@ -214,7 +215,7 @@ class P4FabricACLServiceHandler(_ServiceHandler):
                    json_config_rules=rules
                )
            except Exception as ex:
                LOGGER.error("Failed to insert ACL rules on device {} due to {}".format(device.name, ex))
                LOGGER.error("Failed to delete ACL rules from device {} due to {}".format(device.name, ex))
            finally:
                rules.clear()

@@ -225,6 +226,7 @@ class P4FabricACLServiceHandler(_ServiceHandler):
            # You should no longer visit this device port again
            visited.add(dev_port_key)

            if applied_rules > 0:
                LOGGER.info("Deleted {}/{} ACL rules from device {} and port {}".format(
                    applied_rules, actual_rules, device_name, port_id))

+6 −4
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ class P4FabricINTServiceHandler(_ServiceHandler):
            # You should no longer visit this device again
            visited.add(device.name)

            if applied_rules > 0:
                LOGGER.info("Installed {}/{} INT rules on device {}".format(
                    applied_rules, actual_rules, device.name))

@@ -191,6 +192,7 @@ class P4FabricINTServiceHandler(_ServiceHandler):
            # You should no longer visit this device again
            visited.add(device.name)

            if applied_rules > 0:
                LOGGER.info("Deleted {}/{} INT rules from device {}".format(
                    applied_rules, actual_rules, device.name))

+7 −5
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ class P4FabricL2SimpleServiceHandler(_ServiceHandler):
            # You should no longer visit this device port again
            visited.add(dev_port_key)

            if applied_rules > 0:
                LOGGER.info("Installed {}/{} L2 rules on device {} and port {}".format(
                    applied_rules, actual_rules, device_name, port_id))

@@ -197,7 +198,7 @@ class P4FabricL2SimpleServiceHandler(_ServiceHandler):
                    json_config_rules=rules
                )
            except Exception as ex:
                LOGGER.error("Failed to insert L2 rules on device {} due to {}".format(device.name, ex))
                LOGGER.error("Failed to delete L2 rules from device {} due to {}".format(device.name, ex))
            finally:
                rules.clear()

@@ -208,6 +209,7 @@ class P4FabricL2SimpleServiceHandler(_ServiceHandler):
            # You should no longer visit this device port again
            visited.add(dev_port_key)

            if applied_rules > 0:
                LOGGER.info("Deleted {}/{} L2 rules from device {} and port {}".format(
                    applied_rules, actual_rules, device_name, port_id))

+7 −5
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ class P4FabricL3ServiceHandler(_ServiceHandler):
            # You should no longer visit this device port again
            visited.add(dev_port_key)

            if applied_rules > 0:
                LOGGER.info("Installed {}/{} L3 rules on device {} and port {}".format(
                    applied_rules, actual_rules, device_name, port_id))

@@ -195,7 +196,7 @@ class P4FabricL3ServiceHandler(_ServiceHandler):
                    json_config_rules=rules
                )
            except Exception as ex:
                LOGGER.error("Failed to insert L3 rules on device {} due to {}".format(device.name, ex))
                LOGGER.error("Failed to delete L3 rules from device {} due to {}".format(device.name, ex))
            finally:
                rules.clear()

@@ -206,6 +207,7 @@ class P4FabricL3ServiceHandler(_ServiceHandler):
            # You should no longer visit this device port again
            visited.add(dev_port_key)

            if applied_rules > 0:
                LOGGER.info("Deleted {}/{} L3 rules from device {} and port {}".format(
                    applied_rules, actual_rules, device_name, port_id))

Loading