Skip to content

Commit 9701779

Browse files
committed
Fix assignment of INCIDENT_REPO for SMELT incidents after e429c76
1 parent e429c76 commit 9701779

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

openqabot/types/incidents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def normalize_repos(config):
5050
return ret
5151

5252
@staticmethod
53-
def _repo_osuse(chan: Repos) -> Union[Repos, Tuple[str, str]]:
53+
def _repo_osuse(chan: Repos) -> Union[Tuple[str, str, str], Tuple[str, str]]:
5454
if chan.product == "openSUSE-SLE":
5555
return chan.product, chan.version
56-
return chan
56+
return chan.product, chan.version, chan.arch
5757

5858
@staticmethod
5959
def _is_scheduled_job(

tests/test_incidents.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,16 @@ def test_incidents_call_public_cloud_pint_query(request_mock, monkeypatch):
329329
res = inc(incidents=[MyIncident_4()], token={}, ci_url="", ignore_onetime=False)
330330
assert len(res) == 1
331331
assert "PUBLIC_CLOUD_IMAGE_ID" in res[0]["openqa"]
332+
333+
334+
def test_making_repo_url():
335+
s = {"VERSION": "", "DISTRI": None}
336+
c = {"FLAVOR": {"AAA": {"archs": [""], "issues": {"1234": ":"}}}}
337+
incs = Incidents(product="", settings=s, config=c, extrasettings=set())
338+
inc = MyIncident_0()
339+
inc.id = 42
340+
exp_repo_start = "http://%REPO_MIRROR_HOST%/ibs/SUSE:/Maintenance:/42/"
341+
repo = incs._make_repo_url(inc, Repos("openSUSE", "15.7", "x86_64"))
342+
assert repo == exp_repo_start + "SUSE_Updates_openSUSE_15.7_x86_64"
343+
repo = incs._make_repo_url(inc, Repos("openSUSE-SLE", "15.7", "x86_64"))
344+
assert repo == exp_repo_start + "SUSE_Updates_openSUSE-SLE_15.7"

0 commit comments

Comments
 (0)