Set the qacontact info in one place to reduce code duplication

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2019-11-22 10:18:38 +01:00 committed by Nils Philippsen
parent cd9696f0cb
commit 5c4a6dc32a

View file

@ -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 = '<default: extras-qa@...>'
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'<default: extras-qa@...>'
# 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'<default: extras-qa@...>'
data = {
'product': self.config['products'][collection],
'component': package,