Disable in bugzilla components that are retired in Fedora

This way components that are retired in Fedora will not get any new bug
report.

Fixes https://pagure.io/fedora-infrastructure/issue/7639

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-04-22 14:26:19 +02:00
parent 3ed514eaa1
commit abf7b7f747

View file

@ -215,6 +215,7 @@ class BugzillaProxy:
'description': package['description'],
'initialqacontact': package['default_qa_contact'],
'initialcclist': package['default_cc'],
'is_active': package['is_active'],
}
product_info_by_pkg[package['name'].lower()] = product_info
self.product_cache[collection] = product_info_by_pkg
@ -397,21 +398,23 @@ class BugzillaProxy:
data['initialcclist'] = initial_cc_emails
break
if product[pkg_key]['is_active'] != (not retired):
data['is_active'] = not retired
if data:
# Changes occurred. Submit a request to change via xmlrpc
data['product'] = bz_product_name
data['component'] = package
data["is_active"] = not retired
if self.config["verbose"]:
for key in ["initialowner", "description", "initialqacontact", "initialcclist"]:
if data.get(key):
for key in ["initialowner", "description", "initialqacontact", "initialcclist", "is_active"]:
if data.get(key) is not None:
old_value = product[pkg_key][key]
if not isinstance(old_value, str):
if isinstance(old_value, list):
old_value = sorted(old_value)
new_value = data.get(key)
if not isinstance(new_value, str):
if isinstance(new_value, list):
new_value = sorted(new_value)
if print_fas_names and key in ('initialowner',