def nodes(self): nodes_ = [] for n in self.rspec.findall(".//{%s}node" % (self.none)): s_ = None sliver_ = n.find("{%s}sliver_type" % (self.none)) if sliver_ is not None: s_ = sliver_.attrib.get("name") n_ = Node(n.attrib.get("client_id"), n.attrib.get("component_manager_id"), n.attrib.get("exclusive"), s_) for i in n.iterfind("{%s}interface" % (self.none)): i_ = Interface(i.attrib.get("client_id")) for sv in i.iterfind("{%s}link_shared_vlan" % (self.__sv)): if sv.attrib.get("vlantag") == "0": staticPort = i.attrib.get("client_id").split("_")[-1] staticPortVlan = self.SEStaticLinkManager.chooseVlan( staticPort) i_.add_vlan(staticPortVlan, sv.attrib.get("name")) else: i_.add_vlan(sv.attrib.get("vlantag"), sv.attrib.get("name")) n_.add_interface(i_.serialize()) nodes_.append(n_.serialize()) return nodes_
def nodes(self): nodes_ = [] for n in self.rspec.iterchildren("{%s}node" % (self.none)): s_ = None sliver_type = n.find("{%s}sliver_type" % (self.none)) if sliver_type is not None: s_ = sliver_type.attrib.get("name") n_ = Node(n.attrib.get("component_id"), n.attrib.get("component_manager_id"), n.attrib.get("exclusive"), s_) for i in n.iterfind("{%s}interface" % (self.none)): i_ = Interface(i.attrib.get("component_id")) n_.add_interface(i_.serialize()) nodes_.append(n_.serialize()) return nodes_
def get_nodes(self, rspec): nodes_ = [] for n in rspec.findall(".//{%s}node" % (self.none)): s_ = None sliver_ = n.find("{%s}sliver_type" % (self.none)) if sliver_ is not None: s_ = sliver_.attrib.get("name") n_ = Node(n.attrib.get("client_id"), n.attrib.get("component_manager_id"), n.attrib.get("exclusive"), s_) for i in n.iterfind("{%s}interface" % (self.none)): i_ = Interface(i.attrib.get("client_id")) for sv in i.iterfind("{%s}link_shared_vlan" % (self.__sv)): i_.add_vlan(sv.attrib.get("vlantag"), sv.attrib.get("name")) n_.add_interface(i_.serialize()) nodes_.append(n_.serialize()) return nodes_