def mac(self): macs = self.network.findAdj(self, ntype=Mac) try: return Toolbox.getUnique(macs) except IndexError: return None except Toolbox.NonUniqueError: # If there are multiples, just give the first one. return macs[0]
def host(self): hosts = self.network.findAdj(self, ntype=Host) return Toolbox.getUnique(hosts)
def mac(self): macs = self.network.findAdj(self, ntype=Mac) try: return Toolbox.getUnique(macs) except IndexError: return None