From 4b269fba0ca273dfa3acf44c9f5490f01e0c3d87 Mon Sep 17 00:00:00 2001 From: Trevor Bramwell Date: Fri, 22 Sep 2017 12:23:36 -0700 Subject: Rename pharos-dashboard and pharos-validator As subdirectories of the pharos-tools repo, there is little need to keep the pharos prefix. Change-Id: Ica3d79411f409df638647300036c0664183c2725 Signed-off-by: Trevor Bramwell --- .../src/validation_tool/bin/pharos-validator-node | 92 ---------------------- 1 file changed, 92 deletions(-) delete mode 100755 pharos-validator/src/validation_tool/bin/pharos-validator-node (limited to 'pharos-validator/src/validation_tool/bin/pharos-validator-node') diff --git a/pharos-validator/src/validation_tool/bin/pharos-validator-node b/pharos-validator/src/validation_tool/bin/pharos-validator-node deleted file mode 100755 index e81bc1b..0000000 --- a/pharos-validator/src/validation_tool/bin/pharos-validator-node +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env/python3 -############################################################################## -# Copyright (c) 2015 Todd Gaunt and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -import argparse -import os -import sys -import logging - -from pharosvalidator import node - -def main(): - """Run validation tests on machine, then send results back to server - on jump host""" - args = parse_args() - - logger = configure_root_logger(0) - - if args["test"] == "hardware": - result = node.hardware_test() - elif args["test"] == "network": - result = node.network_test() - else: - logger.error("Invalid test name chosen, please choose \"hardware\" or \"network\"") - quit() - - logger.debug("TEST RESULTS\n" + "#"*50 + '\n' + result + "#"*50 + '\n') - logger.info("Sending results to host...") - node.send_result(args["host"], args["port"], result) - -def configure_root_logger(loglevel): - # Add a file handler to the default logger - formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") - - # Configure the root logger - stdout_handler = logging.StreamHandler(sys.stdout) - stdout_handler.setLevel(loglevel) - stdout_handler.setFormatter(formatter) - - root_logger = logging.getLogger() - root_logger.addHandler(stdout_handler) - root_logger.setLevel(loglevel) - - return root_logger - -def parse_args(): - """ - parse_args: parse the commandline arguments and configuration file into - a dictionary that can be easily passed and referenced by other functions - - input: None - - output: Dictionary of all commandline arguments and configuration file - settings - """ - logger = logging.getLogger(__name__) - - parser = argparse.ArgumentParser( \ - description='evaluates a system against the pharos specification') - - parser.add_argument('--version', - action="store_true", default=False, - help='display version then exit') - - # Address that the client should connect to - parser.add_argument('-H', '--host', - type=str, default="0.0.0.0", - help='Address of the server results should be \ - uploaded to') - - # Port that the client should connect to - parser.add_argument('-p', '--port', - type=str, default=0, - help='Port of the server results will be uploaded to') - - # Specify which test to run on the node - parser.add_argument('test', metavar='test', - type=str, - help='Which test should be run ["hardware", "network"]') - - args = vars(parser.parse_args()) - - return args - -if __name__ == "__main__": - main() -- cgit 1.2.3-korg