def is_keystone_version_available(session, version):
 d = keystone_discover.Discover(session)
 try:
  d.create_client(version)
 except (discovery_exc.DiscoveryFailure, discovery_exc.VersionNotAvailable):
  return False
 else:
  return True

def is_keystone_version_available ( session , version ) : d = keystone_discover . Discover ( session ) try : d . create_client ( version ) except ( discovery_exc . DiscoveryFailure , discovery_exc . VersionNotAvailable ) : return False else : return True
given a pair .