Skip to content
Snippets Groups Projects
Commit dc6d100c authored by Georgios Katsikas's avatar Georgios Katsikas
Browse files

fix: remove unecessary whitespaces

parent 5c837bad
No related branches found
No related tags found
No related merge requests found
...@@ -129,7 +129,7 @@ RULE_CONF_INTERVAL_SEC = 0.1 ...@@ -129,7 +129,7 @@ RULE_CONF_INTERVAL_SEC = 0.1
def arch_tna(arch : str) -> bool: def arch_tna(arch : str) -> bool:
return arch == TARGET_ARCH_TNA return arch == TARGET_ARCH_TNA
def arch_v1model(arch : str) -> bool: def arch_v1model(arch : str) -> bool:
return not arch_tna(arch) return not arch_tna(arch)
...@@ -143,13 +143,13 @@ def generate_random_mac() -> str: ...@@ -143,13 +143,13 @@ def generate_random_mac() -> str:
def prefix_to_hex_mask(prefix_len): def prefix_to_hex_mask(prefix_len):
# Calculate the binary mask # Calculate the binary mask
binary_mask = (1 << 32) - (1 << (32 - prefix_len)) binary_mask = (1 << 32) - (1 << (32 - prefix_len))
# Convert the binary mask to the 4 octets (32 bits) # Convert the binary mask to the 4 octets (32 bits)
mask = struct.pack('!I', binary_mask) mask = struct.pack('!I', binary_mask)
# Convert to a string of hex values # Convert to a string of hex values
hex_mask = ''.join(f'{byte:02x}' for byte in mask) hex_mask = ''.join(f'{byte:02x}' for byte in mask)
return "0x"+hex_mask.upper() return "0x"+hex_mask.upper()
def sleep_for(time_sec : int) -> None: def sleep_for(time_sec : int) -> None:
...@@ -172,7 +172,7 @@ def rules_set_up_port_ingress( ...@@ -172,7 +172,7 @@ def rules_set_up_port_ingress(
assert ingress_port >= 0, "Invalid ingress port to configure ingress port" 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 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" assert chk_vlan_id(vlan_id), "Invalid VLAN ID to configure ingress port"
rule_no = cache_rule(TABLE_INGRESS_VLAN, action) rule_no = cache_rule(TABLE_INGRESS_VLAN, action)
port_type_int = PORT_TYPE_MAP[port_type.lower()] port_type_int = PORT_TYPE_MAP[port_type.lower()]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment