[packit build] Catch an excpetion when failure on fedpkg side
from pathlib import Path
from typing import Optional
+from packit.exceptions import PackitCommandFailedError
+
from packit import utils # so we can mock utils
from packit.utils import logger
@@ -81,6 +83,8 @@ class FedPKG:
cmd += ["--target", koji_target]
if srpm_path:
cmd += ["--srpm", str(srpm_path)]
+
+ try:
utils.run_command_remote(
cmd=cmd,
cwd=self.directory,
@@ -88,6 +92,16 @@ class FedPKG:
fail=True,
)
+ except PackitCommandFailedError as ex:
+ # fail on the fedpkg side, the build is triggered
+ if (
+ "watch_tasks() got an unexpected keyword argument 'ki_handler'"
+ in ex.stderr_output
+ ):
+ logger.info(ex.stdout_output)
+ else:
+ raise ex
+
def clone(self, package_name: str, target_path: str, anonymous: bool = False):
"""
clone a dist-git repo; this has to be done in current env
