Example #1
0
File: device.py Project: Kent1/nxpy
 def buildChildren(self, child_, nodeName_, from_subclass=False):
     if nodeName_ == 'interfaces':
         for node in child_:
             obj_ = Interface()
             obj_.build(node)
             self.interfaces.append(obj_)
     if nodeName_ == 'vlans':
         for node in child_:
             obj_ = Vlan()
             obj_.build(node)
             self.vlans.append(obj_)
     if nodeName_ == 'routing-options':
         for node in child_:
             childName_ = tag_pattern.match(node.tag).groups()[-1]
             # *************** FLOW ****************
             if childName_ == 'flow':
                 obj_ = Flow()
                 obj_.build(node)
                 self.routing_options.append(obj_)
Example #2
0
File: device.py Project: Kent1/nxpy
 def build(self, node):
     for child in node:
         nodeName_ = tag_pattern.match(child.tag).groups()[-1]
         self.buildChildren(child, nodeName_)