def __datapath(self, element): d = Datapath(element.attrib.get("component_id"), element.attrib.get("component_manager_id"), element.attrib.get("dpid")) for p in element.iterfind("{%s}port" % (self.__of)): d.add_port(p.attrib.get("num"), p.attrib.get("name")) return d.serialize()
def datapaths(self): ofdps_ = [] for ofd in self.rspec.iterchildren("{%s}datapath" % (self.__of)): of_ = Datapath(ofd.attrib.get("component_id"), ofd.attrib.get("component_manager_id"), ofd.attrib.get("dpid")) [of_.add_port(p.attrib.get("num"), p.attrib.get("name")) for p in ofd.findall(".//{%s}port" % (self.__of))] ofdps_.append(of_.serialize()) return ofdps_
def datapaths(self): ofdps_ = [] for ofd in self.rspec.iterchildren("{%s}datapath" % (self.__of)): of_ = Datapath(ofd.attrib.get("component_id"), ofd.attrib.get("component_manager_id"), ofd.attrib.get("dpid")) [ of_.add_port(p.attrib.get("num"), p.attrib.get("name")) for p in ofd.findall(".//{%s}port" % (self.__of)) ] ofdps_.append(of_.serialize()) return ofdps_