def _create_glance_client(context, netloc, use_ssl, version=None):
 if (version is None):
  version = CONF.glance_api_version
 params = {}
 if use_ssl:
  scheme = 'https'
  params['insecure'] = CONF.glance_api_insecure
  params['ssl_compression'] = CONF.glance_api_ssl_compression
  params['cacert'] = CONF.glance_ca_certificates_file
 else:
  scheme = 'http'
 if (CONF.auth_strategy == 'keystone'):
  params['token'] = context.auth_token
 if (CONF.glance_request_timeout is not None):
  params['timeout'] = CONF.glance_request_timeout
 endpoint = ('%s://%s' % (scheme, netloc))
 return glanceclient.Client(str(version), endpoint, **params)

def _create_glance_client ( context , netloc , use_ssl , version = None ) : if ( version is None ) : version = CONF . glance_api_version params = { } if use_ssl : scheme = 'https' params [ 'insecure' ] = CONF . glance_api_insecure params [ 'ssl_compression' ] = CONF . glance_api_ssl_compression params [ 'cacert' ] = CONF . glance_ca_certificates_file else : scheme = 'http' if ( CONF . auth_strategy == 'keystone' ) : params [ 'token' ] = context . auth_token if ( CONF . glance_request_timeout is not None ) : params [ 'timeout' ] = CONF . glance_request_timeout endpoint = ( '%s://%s' % ( scheme , netloc ) ) return glanceclient . Client ( str ( version ) , endpoint , ** params )
instantiate a new glanceclient .