def status_check(check_postgresql, check_faraday, check_dependencies, check_config): selected = False exit_code = 0 if check_postgresql: # exit_code was created for Faraday automation-testing purposes exit_code = status_check_functions.print_postgresql_status() status_check_functions.print_postgresql_other_status() selected = True if check_faraday: status_check_functions.print_faraday_status() selected = True if check_dependencies: status_check_functions.print_depencencies_status() selected = True if check_config: status_check_functions.print_config_status() selected = True if not selected: status_check_functions.full_status_check() sys.exit(exit_code)
def get_status_check(path): #Executes status check from with-in the code and uses stdout to save info to file #stdout was the only way to get this information without doing a big refactor original_stdout = sys.stdout sys.stdout = open(path + '/status_check.txt', 'wt') status_check.full_status_check() sys.stdout.close() sys.stdout = original_stdout