def get_cinder_client(session, region):
 endpoint_errors = []
 for version in CINDER_API_SUPPORTED_VERSIONS:
  client = CinderClient(version=version, session=session, region_name=region)
  try:
   client.volumes.list(limit=1, detailed=False)
  except EndpointNotFound as e:
   endpoint_errors.append(e)
   continue
  else:
   return client
 raise CinderAPIVersionDetectionFailure(endpoint_errors)

def get_cinder_client ( session , region ) : endpoint_errors = [ ] for version in CINDER_API_SUPPORTED_VERSIONS : client = CinderClient ( version = version , session = session , region_name = region ) try : client . volumes . list ( limit = 1 , detailed = False ) except EndpointNotFound as e : endpoint_errors . append ( e ) continue else : return client raise CinderAPIVersionDetectionFailure ( endpoint_errors )
create a cinder client from a keystone session .