Esempio n. 1
0
 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]
Esempio n. 2
0
 def host(self):
     hosts = self.network.findAdj(self, ntype=Host)
     return Toolbox.getUnique(hosts)
Esempio n. 3
0
 def mac(self):
     macs = self.network.findAdj(self, ntype=Mac)
     try:
         return Toolbox.getUnique(macs)
     except IndexError:
         return None