def marconi(self): if self._marconi: return self._marconi endpoint_type = self._get_client_option('marconi', 'endpoint_type') endpoint_url = self.url_for(service_type='queuing', endpoint_type=endpoint_type) conf = { 'auth_opts': { 'backend': 'keystone', 'options': { 'os_auth_token': self.auth_token, 'os_auth_url': self.auth_url, 'insecure': self._get_client_option('marconi', 'insecure') } } } self._marconi = marconiclient.Client(endpoint_url, conf=conf) return self._marconi
def _marconi(self, service_type="queuing"): con = self.context if self.auth_token is None: LOG.error(_("Marconi connection failed, no auth_token!")) return None opts = { 'os_auth_token': con.auth_token, 'os_auth_url': con.auth_url, 'os_project_id': con.tenant, 'os_service_type': service_type, } auth_opts = {'backend': 'keystone', 'options': opts} conf = {'auth_opts': auth_opts} endpoint = self.url_for(service_type=service_type) return marconiclient.Client(url=endpoint, conf=conf)