def get_check_class(agentConfig, check_name):
 from config import get_os, get_checks_places, get_valid_check_class
 osname = get_os()
 checks_places = get_checks_places(osname, agentConfig)
 for check_path_builder in checks_places:
  check_path = check_path_builder(check_name)
  if (not os.path.exists(check_path)):
   continue
  (check_is_valid, check_class, load_failure) = get_valid_check_class(check_name, check_path)
  if check_is_valid:
   return check_class
 log.warning(('Failed to load the check class for %s.' % check_name))
 return None

def get_check_class ( agentConfig , check_name ) : from config import get_os , get_checks_places , get_valid_check_class osname = get_os ( ) checks_places = get_checks_places ( osname , agentConfig ) for check_path_builder in checks_places : check_path = check_path_builder ( check_name ) if ( not os . path . exists ( check_path ) ) : continue ( check_is_valid , check_class , load_failure ) = get_valid_check_class ( check_name , check_path ) if check_is_valid : return check_class log . warning ( ( 'Failed to load the check class for %s.' % check_name ) ) return None
return the class object for a given check name .