Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
 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']
Ejemplo n.º 6
0
    def get_compute_client(self, context):

        conf = keystone_utils.get_session_and_auth(context,
                                                   service_type='compute')

        return nova_client(2, **conf)
Ejemplo n.º 7
0
 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']