def setUp(self): super(BaseAPITestCase, self).setUp() self.user_id = 'fake' self.project_id = 'fake' self.context = context.RequestContext(self.user_id, self.project_id) self.compute = self.start_service('compute') self.base_rpcapi = baserpc.BaseAPI(compute_rpcapi.RPC_TOPIC)
def _find_ports(self, req, hosts): """Return a list of backdoor ports for all services in the list.""" context = req.environ['nova.context'] ports = [] #TODO(mtreinish): Figure out how to bind the backdoor socket to 0.0.0.0 # Currently this will only work if the host is resolved as loopback on # the same host as api-server for host in hosts: base = baserpc.BaseAPI(host['service']) _host = host try: _host['port'] = base.get_backdoor_port(context, host['host']) except rpc_common.UnsupportedRpcVersion: _host['port'] = None #NOTE(mtreinish): if the port is None then it wasn't set in # the configuration file for this service. However, that # doesn't necessarily mean that we don't have backdoor ports # for all the services. So, skip the telnet connection for # this service. if _host['port']: ports.append(_host) else: LOG.warning( _("Can't connect to service: %s, no port" "specified\n"), host['service']) return ports
def setUp(self): super(BaseAPITestCase, self).setUp() self.user_id = 'fake' self.project_id = 'fake' self.context = context.RequestContext(self.user_id, self.project_id) self.conductor = self.start_service('conductor') self.compute = self.start_service('compute') self.base_rpcapi = baserpc.BaseAPI(CONF.compute_topic)
def __init__(self): self.conductor_rpcapi = rpcapi.ConductorAPI() self.base_rpcapi = baserpc.BaseAPI(topic=rpcapi.RPC_TOPIC)
def __init__(self): self._manager = rpcapi.ConductorAPI() self.base_rpcapi = baserpc.BaseAPI(topic=CONF.conductor.topic)