refactor: ignore MaxRetryError where HTTPError is ignored

This commit is contained in:
Daike Yu 2025-02-14 09:27:17 +01:00
parent e2560e074f
commit d7af4257c8

View File

@ -15,6 +15,7 @@ from lxml import etree as ET
import osc.conf
import osc.core
from urllib3.exceptions import MaxRetryError
from osclib.core import devel_project_get
from osclib.core import devel_project_fallback
from osclib.core import entity_exists
@ -565,6 +566,8 @@ class CheckSource(ReviewBot.ReviewBot):
return True
except HTTPError:
pass
except MaxRetryError:
pass
return False
def check_action_add_role(self, request, action):
@ -586,6 +589,8 @@ class CheckSource(ReviewBot.ReviewBot):
root = ET.fromstring(result)
except HTTPError:
return None
except MaxRetryError:
return None
# Decline the delete request if there is another delete/submit request against the same package
query = "match=state/@name='new'+and+(action/target/@project='{}'+and+action/target/@package='{}')"\