From a0dd88dc23c13cb9abe13c3d4e63aa14ddbcfda8 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Tue, 20 Aug 2024 11:18:06 -0700 Subject: [PATCH] refactor test mode --- py/desitransfer/tucson.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/py/desitransfer/tucson.py b/py/desitransfer/tucson.py index 893f28e..59834a3 100644 --- a/py/desitransfer/tucson.py +++ b/py/desitransfer/tucson.py @@ -316,14 +316,17 @@ def main(): while any([v[0] is not None for v in proc_pool.values()]): for proc_key in proc_pool: proc, LOG, d = proc_pool[proc_key] - if options.test and proc is not None: - log.debug("%s: %s -> %s", d, ' '.join(proc), LOG) if proc is None: status = None else: - status = proc.poll() + if options.test: + log.debug("%s: %s -> %s", d, ' '.join(proc), LOG) + status = 0 + else: + status = proc.poll() if status is not None: - LOG.close() + if not options.test: + LOG.close() if status != 0: log.critical("rsync error detected for %s/%s/! Check logs!", dst, d) proc_pool[proc_key] = _get_proc(directories, exclude, src, dst, options)