def _glanceclient_from_endpoint(context, endpoint, version=1):
 params = {}
 params['identity_headers'] = generate_identity_headers(context)
 if endpoint.startswith('https://'):
  params['insecure'] = CONF.glance.api_insecure
  params['ssl_compression'] = False
  sslutils.is_enabled(CONF)
  if CONF.ssl.cert_file:
   params['cert_file'] = CONF.ssl.cert_file
  if CONF.ssl.key_file:
   params['key_file'] = CONF.ssl.key_file
  if CONF.ssl.ca_file:
   params['cacert'] = CONF.ssl.ca_file
 return glanceclient.Client(str(version), endpoint, **params)

def _glanceclient_from_endpoint ( context , endpoint , version = 1 ) : params = { } params [ 'identity_headers' ] = generate_identity_headers ( context ) if endpoint . startswith ( 'https://' ) : params [ 'insecure' ] = CONF . glance . api_insecure params [ 'ssl_compression' ] = False sslutils . is_enabled ( CONF ) if CONF . ssl . cert_file : params [ 'cert_file' ] = CONF . ssl . cert_file if CONF . ssl . key_file : params [ 'key_file' ] = CONF . ssl . key_file if CONF . ssl . ca_file : params [ 'cacert' ] = CONF . ssl . ca_file return glanceclient . Client ( str ( version ) , endpoint , ** params )
instantiate a new glanceclient .