Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
afc0d032
Commit
afc0d032
authored
May 3, 2023
by
David Schmitz
Browse files
Options
Downloads
Patches
Plain Diff
fix/ipv6_checksync
parent
b400d56b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/jncdevice.py
+20
-2
20 additions, 2 deletions
utils/jncdevice.py
with
20 additions
and
2 deletions
utils/jncdevice.py
+
20
−
2
View file @
afc0d032
...
@@ -18,6 +18,9 @@ import re as re_
...
@@ -18,6 +18,9 @@ import re as re_
import
os
import
os
from
lxml
import
etree
as
etree_
from
lxml
import
etree
as
etree_
import
flowspec.logging_utils
logger
=
flowspec
.
logging_utils
.
logger_init_default
(
__name__
,
"
celery_netconf_xml.log
"
,
False
)
new_ele
=
lambda
tag
,
attrs
=
{},
**
extra
:
etree_
.
Element
(
tag
,
attrs
,
**
extra
)
new_ele
=
lambda
tag
,
attrs
=
{},
**
extra
:
etree_
.
Element
(
tag
,
attrs
,
**
extra
)
sub_ele
=
lambda
parent
,
tag
,
attrs
=
{},
**
extra
:
etree_
.
SubElement
(
parent
,
tag
,
attrs
,
**
extra
)
sub_ele
=
lambda
parent
,
tag
,
attrs
=
{},
**
extra
:
etree_
.
SubElement
(
parent
,
tag
,
attrs
,
**
extra
)
...
@@ -98,11 +101,25 @@ class Device(object):
...
@@ -98,11 +101,25 @@ class Device(object):
if
nodeName_
==
'
routing-options
'
:
if
nodeName_
==
'
routing-options
'
:
for
node
in
child_
:
for
node
in
child_
:
childName_
=
Tag_pattern_
.
match
(
node
.
tag
).
groups
()[
-
1
]
childName_
=
Tag_pattern_
.
match
(
node
.
tag
).
groups
()[
-
1
]
# *************** FLOW ****************
logger
.
info
(
"
jncdevice::Device::build(): routing-options childName_=
"
+
str
(
childName_
))
flow_node
=
None
if
childName_
==
'
flow
'
:
flow_node
=
node
elif
childName_
==
'
rib
'
:
# IPv6 rule support
for
node2
in
node
:
childName_
=
Tag_pattern_
.
match
(
node2
.
tag
).
groups
()[
-
1
]
if
childName_
==
'
flow
'
:
if
childName_
==
'
flow
'
:
flow_node
=
node2
break
# *************** FLOW ****************
if
flow_node
!=
None
:
obj_
=
Flow
()
obj_
=
Flow
()
obj_
.
build
(
node
)
obj_
.
build
(
flow_node
)
logger
.
info
(
"
jncdevice::Device::build(): => flow_node=
"
+
str
(
flow_node
)
+
"
=> obj_=
"
+
str
(
obj_
))
self
.
routing_options
.
append
(
obj_
)
self
.
routing_options
.
append
(
obj_
)
if
nodeName_
==
'
protocols
'
:
if
nodeName_
==
'
protocols
'
:
for
node
in
child_
:
for
node
in
child_
:
childName_
=
Tag_pattern_
.
match
(
node
.
tag
).
groups
()[
-
1
]
childName_
=
Tag_pattern_
.
match
(
node
.
tag
).
groups
()[
-
1
]
...
@@ -380,6 +397,7 @@ class Flow(object):
...
@@ -380,6 +397,7 @@ class Flow(object):
def
__init__
(
self
,
is_ipv4
=
True
):
def
__init__
(
self
,
is_ipv4
=
True
):
self
.
routes
=
[]
self
.
routes
=
[]
self
.
is_ipv4
=
is_ipv4
self
.
is_ipv4
=
is_ipv4
logger
.
info
(
"
jncdevice::Flow::Flow(): is_ipv4=
"
+
str
(
is_ipv4
))
def
export
(
self
):
def
export
(
self
):
...
...
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
sign in
to comment