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