def check_major_version(api_version):
 available_versions = get_available_major_versions()
 if ((not api_version.is_null()) and (str(api_version.ver_major) not in available_versions)):
  if (len(available_versions) == 1):
   msg = (_("Invalid client version '%(version)s'. Major part should be '%(major)s'") % {'version': api_version.get_string(), 'major': available_versions[0]})
  else:
   msg = (_("Invalid client version '%(version)s'. Major part must be one of: '%(major)s'") % {'version': api_version.get_string(), 'major': ', '.join(available_versions)})
  raise exceptions.UnsupportedVersion(msg)

def check_major_version ( api_version ) : available_versions = get_available_major_versions ( ) if ( ( not api_version . is_null ( ) ) and ( str ( api_version . ver_major ) not in available_versions ) ) : if ( len ( available_versions ) == 1 ) : msg = ( _ ( "Invalid client version '%(version)s'. Major part should be '%(major)s'" ) % { 'version' : api_version . get_string ( ) , 'major' : available_versions [ 0 ] } ) else : msg = ( _ ( "Invalid client version '%(version)s'. Major part must be one of: '%(major)s'" ) % { 'version' : api_version . get_string ( ) , 'major' : ', ' . join ( available_versions ) } ) raise exceptions . UnsupportedVersion ( msg )
checks major part of apiversion obj is supported .