class LinuxBridgeAgent(BaseAgent):
+
'''
Linux bridge Collector Agent
'''
# Other bridge port
else:
- #### VLAN interface
+ # VLAN interface
if self._cu.get_port_vlan_master_if(port_name) != self._cu.PORT_VLAN_UNSPECIFIED:
- master_if = self._cu.get_port_vlan_master_if(port_name)
+ master_if = self._cu.get_port_vlan_master_if(
+ port_name)
if master_if in self._port_to_br:
print port_name + " " + master_if
self._port_to_br[port_name] = br_src
or self._u.d_push(re.match(r'^bond\d+$', master_if)):
self._cu.add_linkpair(
Device(br_src, Device.BR_TYPE),
- Device("Physical NW", Device.PHYNET_TYPE),
+ Device(
+ "Physical NW", Device.PHYNET_TYPE),
Port(port_name, Port.DEFAULT_TYPE),
Port(""))
-
+
else:
continue
# self._cu.add_linkpair(
# Device("INTERNAL", Device.OS_ROUTE_TYPE),
# Port(port_name),
# Port(""))
- ## if (phys if):
-
+ # if (phys if):
+
# bridge interface line
# [interfaces]
elif self._u.d_push(re.match(r'^\s+(\S+)$', br_line)) is not None:
continue
br_dst = self._port_to_br[peer_dst]
- #if self._cu.exist_linkpair(br_src, br_dst, peer_src, peer_dst):
+ # if self._cu.exist_linkpair(br_src, br_dst, peer_src, peer_dst):
# continue
if peer_dst in self._port_to_br:
# Other bridge port
else:
-
- #### VLAN interface
+
+ # VLAN interface
if self._cu.get_port_vlan_master_if(port_name) != self._cu.PORT_VLAN_UNSPECIFIED:
- master_if = self._cu.get_port_vlan_master_if(port_name)
+ master_if = self._cu.get_port_vlan_master_if(
+ port_name)
if master_if in self._port_to_br:
port_src = port_name
port_dst = master_if
Port(port_src),
port_dst_obj,
self._formatter.VLAN_DIST_FORMAT)
-
+
else:
continue
# self._cu.add_linkpair(
# Device("INTERNAL", Device.OS_ROUTE_TYPE),
# Port(port_name),
# Port(""))
- ## if (phys if):
+ # if (phys if):
# if port_name not in self._port_to_br and br_name != "":
# self._port_to_br[port_name] = br_name
-#
-# ## for OpenStack quntum...
+#
+# for OpenStack quntum...
# if self._u.d_push(re.match(r'^qvb(.+)', port_name)):
# quantum_idprefix = self._u.d_pop().group(1)
# if "qvo" + quantum_idprefix in self._port_to_br:
# Device("INTERNAL", Device.OS_ROUTE_TYPE),
# Port(port_name),
# Port(""))
-# #print "int: " + br_name + ": " + port_name
-
+# print "int: " + br_name + ": " + port_name