Beispiel #1
0
def client():
    session = sessions.cache().get_session(sessions.SESSION_TYPE_NOVA)
    nova = nova_client.Client('2',
                              session=session,
                              auth=keystone.auth(),
                              endpoint_type=CONF.nova.endpoint_type)
    nova.images = images.SaharaImageManager(nova)
    return nova
Beispiel #2
0
def client():
    ctx = context.current()
    auth_url = base.retrieve_auth_url()
    compute_url = base.url_for(ctx.service_catalog, 'compute')

    nova = nova_client.Client(username=ctx.username,
                              api_key=None,
                              project_id=ctx.tenant_id,
                              auth_url=auth_url)

    nova.client.auth_token = ctx.token
    nova.client.management_url = compute_url
    nova.images = images.SaharaImageManager(nova)
    return nova