def get_compute_client(self, context): security_ctx = context.security conf = keystone_utils.get_session_and_auth(security_ctx, service_type='compute') return nova_client(2, **conf)
def get_compute_client(self, context): security_ctx = context.security conf = keystone_utils.get_session_and_auth( security_ctx, service_type='compute' ) return nova_client(2, **conf)
def get_object_client(self, context): swift_endpoint = keystone_utils.get_endpoint_for_project( context, 'swift') session_and_auth = keystone_utils.get_session_and_auth( context, service_name='swift') kwargs = { 'preauthurl': swift_endpoint.url % { 'tenant_id': context.project_id }, 'session': session_and_auth['session'], 'insecure': context.insecure, 'retries': 10, 'starting_backoff': 3, 'max_backoff': 120 } return swift_client.Connection(**kwargs)
def get_messaging_client(self, context): zaqar_endpoint = keystone_utils.get_endpoint_for_project( context, service_type='messaging') session_and_auth = keystone_utils.get_session_and_auth( context, service_type='messaging') auth_uri = context.auth_uri or \ keystone_utils.CONF.keystone_authtoken.auth_uri opts = { 'os_auth_token': context.auth_token, 'os_auth_url': auth_uri, 'os_project_id': context.project_id, 'insecure': context.insecure, } auth_opts = { 'backend': 'keystone', 'options': opts, } conf = {'auth_opts': auth_opts, 'session': session_and_auth['session']} return zaqarclient.Client(zaqar_endpoint.url, conf=conf)
def get_session(self, context, service_name): session_and_auth = keystone_utils.get_session_and_auth( context, service_name=service_name) return session_and_auth['session']
def get_compute_client(self, context): conf = keystone_utils.get_session_and_auth(context, service_type='compute') return nova_client(2, **conf)
def get_session(self, context, service_name): session_and_auth = keystone_utils.get_session_and_auth( context, service_name=service_name ) return session_and_auth['session']