From 5c4a6dc32a51eb2058ad9e01a7ad959d7fa1892a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Fri, 22 Nov 2019 10:18:38 +0100 Subject: [PATCH] Set the qacontact info in one place to reduce code duplication Signed-off-by: Pierre-Yves Chibon --- distgit_bugzilla_sync/script.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index f8423ba..2d627fc 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -257,18 +257,18 @@ class BugzillaProxy: e.args = ('ProtocolError', e.errcode, e.errmsg) raise + # Set the qacontact_email and name + if qacontact: + qacontact_email = self._get_bugzilla_email(qacontact) + else: + qacontact_email = 'extras-qa@fedoraproject.org' + qacontact = '' + pkg_key = package.lower() if pkg_key in product: # edit the package information data = {} - # Grab bugzilla email for things changable via xmlrpc - if qacontact: - qacontact_email = self._get_bugzilla_email(qacontact) - else: - qacontact_email = 'extras-qa@fedoraproject.org' - qacontact = f'' - # Check for changes to the owner, qacontact, or description if product[pkg_key]['initialowner'] != owner_email: data['initialowner'] = owner_email @@ -348,12 +348,6 @@ class BugzillaProxy: raise else: # Add component - if qacontact: - qacontact_email = self._get_bugzilla_email(qacontact) - else: - qacontact_email = 'extras-qa@fedoraproject.org' - qacontact = f'' - data = { 'product': self.config['products'][collection], 'component': package,