Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
dc6d100c
Commit
dc6d100c
authored
2 months ago
by
Georgios Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove unecessary whitespaces
parent
5c837bad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/service/service/service_handlers/p4_fabric_tna_commons/p4_fabric_tna_commons.py
+5
-5
5 additions, 5 deletions
...e_handlers/p4_fabric_tna_commons/p4_fabric_tna_commons.py
with
5 additions
and
5 deletions
src/service/service/service_handlers/p4_fabric_tna_commons/p4_fabric_tna_commons.py
+
5
−
5
View file @
dc6d100c
...
@@ -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
:
02
x
}
'
for
byte
in
mask
)
hex_mask
=
''
.
join
(
f
'
{
byte
:
02
x
}
'
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
()]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment