Exemplo n.º 1
0
def main(test_script_path, user_identity_path):
    """
    main module
    """
    user_identity = load_identity_from_file(user_identity_path)
    _initialize_logging(user_identity.user_name)
    log = logging.getLogger("main")
    log.info("program starts")

    halt_event = Event()
    signal.signal(signal.SIGTERM, _create_signal_handler(halt_event))

    log.info("loading test script from %r" % (test_script_path, ))
    with open(test_script_path, "rt") as input_file:
        test_script = json.load(input_file)

    customer = BaseCustomer(halt_event, user_identity, test_script)

    try:
        customer._main_loop()
    except Exception, instance:
        log.exception(instance)
        return -1
def main(test_script_path, user_identity_path):
    """
    main module
    """
    user_identity = load_identity_from_file(user_identity_path)
    _initialize_logging(user_identity.user_name)
    log = logging.getLogger("main")
    log.info("program starts")

    halt_event = Event()
    signal.signal(signal.SIGTERM, _create_signal_handler(halt_event))

    log.info("loading test script from %r" % (test_script_path, ))
    with open(test_script_path, "rt") as input_file:
        test_script = json.load(input_file)

    customer = BaseCustomer(halt_event, user_identity, test_script)

    try:
        customer._main_loop()
    except Exception, instance:
        log.exception(instance)
        return -1
 def __init__(self, halt_event, user_identity, test_script):
     Greenlet.__init__(self)
     BaseCustomer.__init__(self, halt_event, user_identity, test_script)
 def __init__(self, halt_event, user_identity, test_script):
     Greenlet.__init__(self)
     BaseCustomer.__init__(self, halt_event, user_identity, test_script)