def get_keystone_client(self, context, use_trusts=True): if not config.CONF.engine.use_trusts: use_trusts = False env = self._get_environment(context) factory = lambda _1, _2: \ auth_utils.get_client_for_trusts(env.trust_id) \ if use_trusts else auth_utils.get_client(env.token, env.tenant_id) return self.get_client(context, 'keystone', use_trusts, factory)
def get_keystone_client(self, use_trusts=True): if not CONF.engine.use_trusts: use_trusts = False factory = lambda _1, _2: \ auth_utils.get_client_for_trusts(self._environment.trust_id) \ if use_trusts else auth_utils.get_client( self._environment.token, self._environment.tenant_id) return self.get_client('keystone', use_trusts, factory)
def get_keystone_client(self, context, use_trusts=True): if not CONF.engine.use_trusts: use_trusts = False env = self._get_environment(context) factory = lambda _1, _2: \ auth_utils.get_client_for_trusts(env.trust_id) \ if use_trusts else auth_utils.get_client(env.token, env.tenant_id) return self.get_client(context, 'keystone', use_trusts, factory)
def get_network_driver(context): ks = auth_utils.get_client(context.auth_token, context.tenant) try: ks.service_catalog.url_for(service_type='network') except ks_exceptions.EndpointNotFound: LOG.debug("Will use NovaNetwork as a network driver") return "nova" else: LOG.debug("Will use Neutron as a network driver") return "neutron"