From dc6d100cfa961ba32e7dc72150901cd40f7529e8 Mon Sep 17 00:00:00 2001 From: "Georgios P. Katsikas" <gkatsikas@ubitech.eu> Date: Sat, 22 Mar 2025 08:27:07 +0000 Subject: [PATCH] fix: remove unecessary whitespaces --- .../p4_fabric_tna_commons/p4_fabric_tna_commons.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/service/service/service_handlers/p4_fabric_tna_commons/p4_fabric_tna_commons.py b/src/service/service/service_handlers/p4_fabric_tna_commons/p4_fabric_tna_commons.py index eb8077ff3..4b60f9118 100644 --- a/src/service/service/service_handlers/p4_fabric_tna_commons/p4_fabric_tna_commons.py +++ b/src/service/service/service_handlers/p4_fabric_tna_commons/p4_fabric_tna_commons.py @@ -129,7 +129,7 @@ RULE_CONF_INTERVAL_SEC = 0.1 def arch_tna(arch : str) -> bool: return arch == TARGET_ARCH_TNA - + def arch_v1model(arch : str) -> bool: return not arch_tna(arch) @@ -143,13 +143,13 @@ def generate_random_mac() -> str: def prefix_to_hex_mask(prefix_len): # Calculate the binary mask binary_mask = (1 << 32) - (1 << (32 - prefix_len)) - + # Convert the binary mask to the 4 octets (32 bits) mask = struct.pack('!I', binary_mask) - + # Convert to a string of hex values hex_mask = ''.join(f'{byte:02x}' for byte in mask) - + return "0x"+hex_mask.upper() def sleep_for(time_sec : int) -> None: @@ -172,7 +172,7 @@ def rules_set_up_port_ingress( assert ingress_port >= 0, "Invalid ingress port to configure ingress port" assert port_type.lower() in PORT_TYPES_STR_VALID, "Invalid port type to configure ingress port" assert chk_vlan_id(vlan_id), "Invalid VLAN ID to configure ingress port" - + rule_no = cache_rule(TABLE_INGRESS_VLAN, action) port_type_int = PORT_TYPE_MAP[port_type.lower()] -- GitLab