def createIndex(self, hosts): self.treeWordsTries = TreeWordsTries() self.treeWordsTries.clear() for k in hosts.keys(): h = hosts[k] self.treeWordsTries.addWord(h.getName()) for intr in h.getAllInterfaces(): ipv4 = intr.ipv4 ipv6 = intr.ipv6 if not ipv4['address'] in ["0.0.0.0", None]: self.treeWordsTries.addWord(ipv4['address']) if not ipv6['address'] in ["0000:0000:0000:0000:0000:0000:0000:0000", None]: self.treeWordsTries.addWord(ipv6['address']) for hostname in intr.getHostnames(): self.treeWordsTries.addWord(hostname)
def createIndex(self, hosts): self.treeWordsTries = TreeWordsTries() self.treeWordsTries.clear() for k in hosts.keys(): h = hosts[k] self.treeWordsTries.addWord(h.getName()) for intr in h.getAllInterfaces(): ipv4 = intr.ipv4 ipv6 = intr.ipv6 if not ipv4['address'] in ["0.0.0.0", None]: self.treeWordsTries.addWord(ipv4['address']) if not ipv6['address'] in [ "0000:0000:0000:0000:0000:0000:0000:0000", None ]: self.treeWordsTries.addWord(ipv6['address']) for hostname in intr.getHostnames(): self.treeWordsTries.addWord(hostname)