6475c37330
Change-Id: If421d82e4c3522a008054c31a2003e81d591bbd3
977 B
977 B
Authenticate against an Image service endpoint
To authenticate against an Image service endpoint, instantiate a glanceclient.v2.client.Client object:
from os import environ as env
import glanceclient.v2.client as glclient
import keystoneclient.v2_0.client as ksclient
= ksclient.Client(auth_url=env['OS_AUTH_URL'],
keystone =env['OS_USERNAME'],
username=env['OS_PASSWORD'],
password=env['OS_TENANT_NAME'],
tenant_name=env['OS_REGION_NAME'])
region_name= keystone.service_catalog.url_for(service_type='image')
glance_endpoint = glclient.Client(glance_endpoint, token=keystone.auth_token) glance