parameters: ()
docstring: Execute Main Entry point.
docstring_summary: Execute Main Entry point.
docstring_tokens: Execute Main Entry point .
function: def main():
      # type: () -> None
      """Execute Main Entry point."""
  
      parser = argparse.ArgumentParser(description='MongoDB CryptD Check Tool.')
  
      parser.add_argument('file', type=str, help="etc/evergreen.yml file")
      parser.add_argument('--variant', type=str, help="Build variant to check for")
  
      args = parser.parse_args()
  
      expected_variants = read_variable_from_yml(args.file, MONGOCRYPTD_VARIANTS)
      if not expected_variants:
          print("ERROR: Could not find node %s in file '%s'" % (MONGOCRYPTD_VARIANTS, args.file),
                file=sys.stderr)
          sys.exit(1)
  
      evg_config = parse_evergreen_file(args.file)
      if can_validation_be_skipped(evg_config, args.variant):
          print(f"Skipping validation on buildvariant {args.variant}")
          sys.exit(0)
  
      if args.variant not in expected_variants:
          print("ERROR: Expected to find variant %s in list %s" % (args.variant, expected_variants),
                file=sys.stderr)
          print(
              "ERROR:  Please add the build variant %s to the %s list in '%s'" %
              (args.variant, MONGOCRYPTD_VARIANTS, args.file), file=sys.stderr)
          sys.exit(1)
  
      sys.exit(0)
function_tokens: def main ( ) : # type: () -> None parser = argparse . ArgumentParser ( description = 'MongoDB CryptD Check Tool.' ) parser . add_argument ( 'file' , type = str , help = "etc/evergreen.yml file" ) parser . add_argument ( '--variant' , type = str , help = "Build variant to check for" ) args = parser . parse_args ( ) expected_variants = read_variable_from_yml ( args . file , MONGOCRYPTD_VARIANTS ) if not expected_variants : print ( "ERROR: Could not find node %s in file '%s'" % ( MONGOCRYPTD_VARIANTS , args . file ) , file = sys . stderr ) sys . exit ( 1 ) evg_config = parse_evergreen_file ( args . file ) if can_validation_be_skipped ( evg_config , args . variant ) : print ( f"Skipping validation on buildvariant {args.variant}" ) sys . exit ( 0 ) if args . variant not in expected_variants : print ( "ERROR: Expected to find variant %s in list %s" % ( args . variant , expected_variants ) , file = sys . stderr ) print ( "ERROR:  Please add the build variant %s to the %s list in '%s'" % ( args . variant , MONGOCRYPTD_VARIANTS , args . file ) , file = sys . stderr ) sys . exit ( 1 ) sys . exit ( 0 )