It looks like the behaviour just depends on having all the usual credentials set -- there's no attempt to contact the server.
I'd guess the:
force_auth=True
below is what's causing _cache_schema to fail, which causes us to revert to v1.
def _cache_schemas(self, options, home_dir='~/.glanceclient'):
homedir = os.path.expanduser(home_dir)
path_prefix = homedir
if options.os_auth_url: hash_host = hashlib.sha1(options.os_auth_url.encode('utf-8')) path_prefix = os.path.join(path_prefix, hash_host.hexdigest())
if not os.path.exists(path_prefix):
try: os.makedirs(path_prefix)
except OSError as e:
# This avoids glanceclient to crash if it can't write to
# ~/.glanceclient, which may happen on some env (for me,
# it happens in Jenkins, as Glanceclient can't write to
# /var/lib/jenkins).
msg = '%s' % e print(encodeutils.safe_decode(msg), file=sys.stderr)
resources = ['image', 'metadefs/namespace', 'metadefs/resource_type'] schema_file_paths = [os.path.join(path_prefix, x + '_schema.json') for x in ['image', 'namespace', 'resource_type']]
client = None failed_download_schema = 0
for resource, schema_file_path in zip(resources, schema_file_paths):
if (not os.path.exists(schema_file_path)) or options.get_schema: try: if not client: client = self._get_versioned_client('2', options, force_auth=True)
It looks like the behaviour just depends on having all the usual credentials set -- there's no attempt to contact the server.
I'd guess the:
force_auth=True
below is what's causing _cache_schema to fail, which causes us to revert to v1.
def _cache_ schemas( self, options, home_dir= '~/.glanceclien t'): expanduser( home_dir) os_auth_ url:
hash_ host = hashlib. sha1(options. os_auth_ url.encode( 'utf-8' ))
path_ prefix = os.path. join(path_ prefix, hash_host. hexdigest( )) exists( path_prefix) :
os.makedirs( path_prefix)
print( encodeutils. safe_decode( msg), file=sys.stderr) namespace' , 'metadefs/ resource_ type']
schema_ file_paths = [os.path. join(path_ prefix, x + '_schema.json')
for x in ['image', 'namespace', 'resource_type']]
homedir = os.path.
path_prefix = homedir
if options.
if not os.path.
try:
except OSError as e:
# This avoids glanceclient to crash if it can't write to
# ~/.glanceclient, which may happen on some env (for me,
# it happens in Jenkins, as Glanceclient can't write to
# /var/lib/jenkins).
msg = '%s' % e
resources = ['image', 'metadefs/
client = None
failed_ download_ schema = 0 exists( schema_ file_path) ) or options.get_schema:
try:
if not client:
client = self._get_ versioned_ client( '2', options,
force_ auth=True)
for resource, schema_file_path in zip(resources, schema_file_paths):
if (not os.path.