Пример #1
0
 def create_rpc_client(self, thishost):
     clnt = self._clients.get(thishost)
     if clnt is None:
         try:
             host_ip = socket.gethostbyname(thishost)
         except socket.gaierror:
             LOG.error(_LE('Invalid host name for agent: %s'), thishost)
         else:
             clnt = rpc.DfaRpcClient(self._url,
                                     '_'.join((self._q_agent, thishost)),
                                     exchange=constants.DFA_EXCHANGE)
             self._clients[thishost] = clnt
             LOG.debug('Created client for agent: %(host)s:%(ip)s',
                       {'host': thishost, 'ip': host_ip})
Пример #2
0
 def setup_client_rpc(self):
     """Setup RPC client for dfa agent."""
     # Setup RPC client.
     self.clnt = rpc.DfaRpcClient(self._url,
                                  constants.DFA_SERVER_QUEUE,
                                  exchange=constants.DFA_EXCHANGE)
Пример #3
0
 def setup_client_rpc(self):
     url = self._cfg.dfa_rpc.transport_url % (
         {'ip': self.ctl_host})
     self.clnt = rpc.DfaRpcClient(url, constants.DFA_SERVER_QUEUE)