def getCapabilities(self): api = API.Global() ret = api.getCapabilities() ret['info']['lastClient'] = self.cif.threadLocal.client ret['info']['lastClientIface'] = getDeviceByIP( self.cif.threadLocal.server) return ret
def Host_getCapabilities_Ret(server_address, ret): """ We need to add additional information to getCaps as it is done for xmlrpc. """ ret['info']['lastClientIface'] = getDeviceByIP(server_address) return ret['info']
def testGetDeviceByIP(self): for addr in nl_addr.iter_addrs(): # Link-local IPv6 addresses are generated from the MAC address, # which is shared between a nic and its bridge. Since We don't # support having the same IP address on two different NICs, and # link-local IPv6 addresses aren't interesting for 'getDeviceByIP' # then ignore them in the test if addr['scope'] != 'link': self.assertEqual( addr['label'], addresses.getDeviceByIP(addr['address'].split('/')[0]))