From a0db65ec648a1e6238a508a9137b5311693dd0b2 Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Sat, 12 Oct 2013 14:03:23 -0400 Subject: [PATCH 1/1] rblanche: avoid crashing on deactivated users When chpoboxing (-c), we get_pobox for each user. moira returns an error for (some) deactivated users, so we should catch that error and report it inline, rather than erroring out entirely. This was discovered by rblanche'ing sipb-prospectives. --- rblanche.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rblanche.py b/rblanche.py index fb31a42..9eb995f 100755 --- a/rblanche.py +++ b/rblanche.py @@ -33,7 +33,10 @@ class RBlanche(object): return members def get_and_format_pobox(self, user): - result = moira.query('get_pobox', user)[0] + try: + result = moira.query('get_pobox', user)[0] + except moira.MoiraException, e: + return "%8s ** moira error: %s **" % (user, e) if result['type'] == 'SMTP': fmt = '-> %s' elif result['type'] == 'SPLIT': -- 2.34.1