- currenttest = test(args.dir)
- currenttest.read_settings()
- currenttest.virtual_environ_setup()
- currenttest.load_recipe()
+ # We just log the version and exit
+ if args.version:
+ logger.info("nitsi version: {}".format("@PACKAGE_VERSION@"))
+ return 0
+
+ # For all other stuff we need logging to a file
+ log_dir = init_logging(args.dir)
+ # We now going to log everything to log_dir/genaral.log
+ fh = logging.FileHandler("{}/general.log".format(log_dir))
+ fh.setLevel(logging.DEBUG)
+ logger.addHandler(fh)
+ logger.debug("We now logging everything to {}/general.log".format(log_dir))
+
+ # here we run a test
+ try:
+ currenttest = test(args.dir, log_dir)
+ currenttest.read_settings()
+ currenttest.virtual_environ_setup()
+ currenttest.load_recipe()
+ except RecipeExeption as e:
+ logger.exception(e)
+ exit(2)
+