コード例 #1
0
ファイル: bindingxmlrpc.py プロジェクト: fancyKai/vdsm
 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
コード例 #2
0
ファイル: Bridge.py プロジェクト: mykaul/vdsm
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']
コード例 #3
0
ファイル: Bridge.py プロジェクト: fancyKai/vdsm
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']
コード例 #4
0
ファイル: netinfo_test.py プロジェクト: mykaul/vdsm
 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]))