From e83b5defe83cf2351b7a9fc6ec8ec7dc50b54af0 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 12 Sep 2013 11:14:08 -0500 Subject: [PATCH] Use check_output() and log.exception() This should help us figure out why our checkouts keep getting deleted. --- teuthology/queue.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/teuthology/queue.py b/teuthology/queue.py index cf277a9233..35afaadb77 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -62,20 +62,22 @@ def fetch_teuthology_branch(path, branch='master'): log.info( subprocess.check_output(('git', 'fetch', '-p', 'origin'), cwd=path) - ) + ) log.info( subprocess.check_output(('touch', path)) - ) + ) else: log.info("%s was just updated; assuming it is current", branch) # This try/except block will notice if the requested branch doesn't # exist, whether it was cloned or fetched. try: - subprocess.check_call(('git', 'reset', '--hard', 'origin/%s' % branch), - cwd=path) + subprocess.check_output( + ('git', 'reset', '--hard', 'origin/%s' % branch), + cwd=path, + ) except subprocess.CalledProcessError: - log.error("teuthology branch not found: %s", branch) + log.exception("teuthology branch not found: %s", branch) shutil.rmtree(path) raise @@ -87,7 +89,7 @@ def fetch_teuthology_branch(path, branch='master'): env['NO_CLOBBER'] = '1' log.info( subprocess.check_output(('./bootstrap'), cwd=path, env=env) - ) + ) finally: lock.release() -- 2.39.5