From 0148596f751baa4107a291f31f1038215ef23526 Mon Sep 17 00:00:00 2001 From: Dominik Rumian Date: Mar 17 2022 13:33:28 +0000 Subject: contaner-build does not check for existence of kojisession.buildContainer When 'container-build' subcommand is used, there was a check for existence of kojisession.buildContainer RPC. This is not necessary because when there is some RPC missing the koji.GenericError is returned and a apropriate error message is printed. Deleting this check will improve performance and lowers load on the Koji hub. Jira: RHELCMP-3799 Fixes: https://pagure.io/rpkg/issue/532 Signed-off-by: Dominik Rumian --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 2a4b3fd..53e6e47 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -3372,9 +3372,6 @@ class Commands(object): rv = 0 # return value of koji task. It is returned as a method result. try: self.load_kojisession() - if "buildContainer" not in self.kojisession.system.listMethods(): - raise RuntimeError("Kojihub instance does not support buildContainer") - build_target = self.kojisession.getBuildTarget(container_target) if not build_target: msg = "Unknown build target: %s" % container_target diff --git a/tests/test_flatpak_build.py b/tests/test_flatpak_build.py index 669b477..32926a8 100644 --- a/tests/test_flatpak_build.py +++ b/tests/test_flatpak_build.py @@ -235,7 +235,6 @@ class FlatpakBuildCase(CommandTestCase): session = Mock() self.kojisession = session - session.system.listMethods.return_value = ['buildContainer'] def load_kojisession(self): self._kojisession = session