Skip to content
Snippets Groups Projects
Commit afc0d032 authored by David Schmitz's avatar David Schmitz
Browse files

fix/ipv6_checksync

parent b400d56b
No related branches found
No related tags found
No related merge requests found
...@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment