From 3307b7c6c296f61e94b27ed75f6b237b5e13785e Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Wed, 5 Sep 2012 10:02:26 -0500 Subject: [PATCH] Hopefully tighted exception handling to fight bad 4G connections on the train. Revert if it breaks things, hasn't so far. --- .../process-git-requests/process-git-requests | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/process-git-requests/process-git-requests b/scripts/process-git-requests/process-git-requests index f631c22..30c93a7 100755 --- a/scripts/process-git-requests/process-git-requests +++ b/scripts/process-git-requests/process-git-requests @@ -697,7 +697,7 @@ def process_change_request(bug, comment, allcomments, firstfound, pkgdb, branche else: pass -def create_branches(package, pkghost, pkghostlocal): +def create_branches(package, pkghost, pkghostlocal, processed): '''If on pkgs01, run /usr/local/bin/pkgdb2branch.py directly. Otherwise, call ssh.''' hostname = os.uname()[1] @@ -706,8 +706,12 @@ def create_branches(package, pkghost, pkghostlocal): cmd.extend(['ssh', pkghost]) cmd.extend(['/usr/local/bin/pkgdb2branch.py', package]) print "Calling pkgdb2branch.py...." - proc = subprocess.check_call(cmd, stdout=sys.stdout, stderr=sys.stderr) + try: + proc = subprocess.check_call(cmd, stdout=sys.stdout, stderr=sys.stderr) + except: + processed.append(package) print + return processed if __name__ == '__main__': branches = {} @@ -770,19 +774,13 @@ if __name__ == '__main__': if type == 'new': (package, more) = process_new_request(i, j, comments['bugs'][str(i.id)]['comments'], firstfound, pkgdb, fas, branches) if package: - try: - create_branches(package, options.pkghost, options.pkghostlocal) - except: - processed.append(package) + processed = create_branches(package, options.pkghost, options.pkghostlocal, processed) if not more: break elif type == 'change': (package, more) = process_change_request(i, j, comments['bugs'][str(i.id)]['comments'], firstfound, pkgdb, branches) if package: - try: - create_branches(package, options.pkghost, options.pkghostlocal) - except: - processed.append(package) + processed = create_branches(package, options.pkghost, options.pkghostlocal, processed) if not more: break