diff --git a/pippin/manager.py b/pippin/manager.py index 0e61d20d..ad0e140a 100644 --- a/pippin/manager.py +++ b/pippin/manager.py @@ -402,7 +402,8 @@ def execute(self, check_config, compress_output, uncompress_output): n = len(squeue) if n == 0 or n > self.max_jobs: self.logger.debug(f"Squeue is reporting {n} NUM_JOBS in the queue... this is either 0 or toeing the line as to too many") - self.log_finals() + num_errs = self.log_finals() + return num_errs def check_task_completion(self, t, squeue): result = t.check_completion(squeue) @@ -471,3 +472,4 @@ def log_finals(self): for w in es: self.logger.error(f"\t{w.message}") + return len(es) diff --git a/run.py b/run.py index edee0b4b..1a3e78c0 100644 --- a/run.py +++ b/run.py @@ -178,7 +178,8 @@ def handler(signum, frame): manager.set_finish(args.finish) manager.set_force_refresh(args.refresh) manager.set_force_ignore_stage(args.ignore) - manager.execute(args.check, args.compress, args.uncompress) + num_errs = manager.execute(args.check, args.compress, args.uncompress) + manager.num_errs = num_errs chown_file(logging_filename) return manager @@ -255,5 +256,7 @@ def get_args(test=False): if __name__ == "__main__": args = get_args() - run(args) + manager = run(args) sys.stdout.flush() + if manager.num_errs > 0: + raise(ValueError(f"{manager.num_errs} Errors found"))