diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-04-05 15:13:29 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-04-05 15:13:29 -0400 |
commit | fec93955bf015348492fe0f6902dcb10b42df75a (patch) | |
tree | 222594c82a46c31da130e26d971095f9068f52ff | |
parent | 8d69c88d256470c8866ef6955c9c5373e9c8b86a (diff) | |
download | bugspray-fec93955bf015348492fe0f6902dcb10b42df75a.tar.gz |
Fix when looking up privacy mode for unknown component
There was a couple of bugs discovered when a bug was moved to a
component for which we don't have a section in the config file. We
should be able to handle this situation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | peebz/bz2pi.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/peebz/bz2pi.py b/peebz/bz2pi.py index 1726d30..373b589 100644 --- a/peebz/bz2pi.py +++ b/peebz/bz2pi.py @@ -121,11 +121,16 @@ def main(cmdargs: argparse.Namespace) -> None: for bdata in buglist: logger.debug('Looking at %s: %s', bdata['id'], bdata['summary']) bid = bdata['id'] - cconf = peebz.get_component_config(bdata['product'], bdata['component']) - if config['bugzilla'].get('privacy_mode', False) or cconf.get('bz_privacy_mode', False): + privacy_mode = False + if config['bugzilla'].get('privacy_mode', False): privacy_mode = True else: - privacy_mode = False + try: + cconf = peebz.get_component_config(bdata['product'], bdata['component']) + if cconf.get('bz_privacy_mode', False): + privacy_mode = True + except KeyError: + pass process_new_comments(bid, privacy_mode=privacy_mode, dry_run=cmdargs.dry_run) seen.add(bid) else: |