示例#1
0
def init_logger(args):
    logger.init_logger('Merlin', directory=args['--logdir'])

    logger.info("Initializing Installer version", version.get_version(),
                output=True)
    logger.info("Using log file", logger.logger_filename(), output=True)
示例#2
0
    # Process Hostname
    if args["--hostname"]:
        os.environ["OMHOSTNAME"] = args["--hostname"]

    app = None
    if args["--cli"] or not app:
        import sx.cli.app
        app = sx.cli.app.CliApplication
    try:
        app(system, args).run()
    except (EOFError, KeyboardInterrupt, SystemExit) as _:
        pass

if __name__ == '__main__':
    from docopt import docopt
    ARGS = docopt(__doc__, version=version.get_version())
    init_logger(ARGS)
    system = System()
    logger.info('Running on:\n', system, output=True)
    try:
        main(ARGS, system)
        #system_tests(system)
        #package_manager_test(system)
        #service_test(system)
    except:
        raise
    finally:
        if __debug__:
            os.remove(logger.logger_filename(base_name=False))