From 5057d3da574a8b1f89b234401a4af3c06e0d283a Mon Sep 17 00:00:00 2001 From: Tomas Hrcka Date: Jul 22 2021 09:34:12 +0000 Subject: [PATCH 1/2] Use FASJSON client in the bugzilla script New release 1.1.1 Signed-off-by: Tomas Hrcka --- diff --git a/config.ini b/config.ini index 907fab7..946000c 100644 --- a/config.ini +++ b/config.ini @@ -2,5 +2,5 @@ pagure_url = https://pagure.io pagure_dist_git_url = https://src.fedoraproject.org pdc_url = https://pdc.fedoraproject.org -fasjson = False +fasjson = True fasjson_url = https://fasjson.fedoraproject.org/ \ No newline at end of file diff --git a/fedscm_admin/bugzilla.py b/fedscm_admin/bugzilla.py index 5cb7b16..82ffd33 100644 --- a/fedscm_admin/bugzilla.py +++ b/fedscm_admin/bugzilla.py @@ -192,15 +192,13 @@ class BugzillaClient(object): raise ValidationError(error) assigned_to_emails = [bug.assigned_to] - if bug.assigned_to in FAS_CLIENT.client.\ - _AccountSystem__alternate_email: - assigned_to_id = FAS_CLIENT.client.\ - _AccountSystem__alternate_email[bug.assigned_to] - assigned_to_user = FAS_CLIENT.get_fas_user_by_id( - assigned_to_id) + + if FAS_CLIENT.get_fas_user(bug.assigned_to): + assigned_to_id = FAS_CLIENT.get_fas_user(bug.assigned_to) + assigned_to_user = FAS_CLIENT.get_fas_user_by_id(assigned_to_id) if assigned_to_user: assigned_to_emails.append( - assigned_to_user['email']) + assigned_to_user) if flag['setter'] not in assigned_to_emails: raise ValidationError('The review is not approved by ' 'the assignee of the Bugzilla ' diff --git a/fedscm_admin/fas.py b/fedscm_admin/fas.py index 35087a1..35fb33f 100644 --- a/fedscm_admin/fas.py +++ b/fedscm_admin/fas.py @@ -39,7 +39,6 @@ class FASClient(object): except fasjson_client.errors.ClientSetupError: raise ClickException('Failed to create fasjson_client.') else: - self.client = AccountSystem('https://admin.fedoraproject.org/accounts') self.unauthenticated_error = ( 'The FAS Client is not authenticated. Please make sure you typed ' 'in the correct credentials.') diff --git a/setup.py b/setup.py index 5bca73a..7b28aef 100644 --- a/setup.py +++ b/setup.py @@ -20,5 +20,5 @@ setup( packages=['fedscm_admin'], package_dir={'fedscm_admin': 'fedscm_admin'}, url='https://pagure.io/fedscm_admin', - version='1.1.0', + version='1.1.1', ) From 56ee137fca192c6bdb8bb2c940bfc87bc46be6b5 Mon Sep 17 00:00:00 2001 From: Tomas Hrcka Date: Jul 22 2021 09:34:12 +0000 Subject: [PATCH 2/2] Enable FASJSON in tests Signed-off-by: Tomas Hrcka --- diff --git a/tests/test_config.ini b/tests/test_config.ini index 4f93e7d..9f2f01a 100644 --- a/tests/test_config.ini +++ b/tests/test_config.ini @@ -5,5 +5,5 @@ pdc_url = https://pdc.local pdc_api_token = 1234 pagure_ticket_api_token = 1234 pagure_api_token = 1234 -fasjson = False +fasjson = True fasjson_url = https://fasjson.stg.fedoraproject.org/