public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpkg] 1.70-1: Patch: Better exit code for connection error
@ 2026-08-10 21:44 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10 21:44 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : b30484594b5a7699179397ddc212008d83cc1079
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2022-04-05T19:14:26+00:00
            Stats  : +57/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/b30484594b5a7699179397ddc212008d83cc1079?branch=1.70-1

            Log:
            Patch: Better exit code for connection error

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
diff --git a/0005-Better-exit-code-for-connection-error.patch b/0005-Better-exit-code-for-connection-error.patch
new file mode 100644
index 0000000..5e19772
--- /dev/null
+++ b/0005-Better-exit-code-for-connection-error.patch
@@ -0,0 +1,52 @@
+From e16dfc94bc40e3c678cfb7041031a4bb7a873a51 Mon Sep 17 00:00:00 2001
+From: Dominik Rumian <drumian@redhat.com>
+Date: Mon, 21 Mar 2022 12:00:00 +0100
+Subject: [PATCH] Better exit code for connection error
+
+When there is a connection failure while running _watch_build_tasks
+method then exit code '2' is returned and apropriate error message
+is logged.
+
+Jira: RHELCMP-5143
+
+Signed-off-by: Dominik Rumian <drumian@redhat.com>
+---
+ pyrpkg/cli.py | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py
+index 6423664..0f95bdc 100644
+--- a/pyrpkg/cli.py
++++ b/pyrpkg/cli.py
+@@ -1887,17 +1887,21 @@ class cliClient(object):
+ 
+         :param list task_ids: a list of task IDs to watch.
+         """
+-        if self.args.nowait:
++        if hasattr(self.args, 'nowait') and self.args.nowait:
+             return
+         # Pass info off to our koji task watcher
+-        if self.args.dry_run:
++        if hasattr(self.args, 'dry_run') and self.args.dry_run:
+             self.log.info('DRY-RUN: Watch tasks: %s', task_ids)
+         else:
+-            return koji_cli.lib.watch_tasks(
+-                self.cmd.kojisession,
+-                task_ids,
+-                ki_handler=utils.make_koji_watch_tasks_handler(self.cmd.build_client)
+-            )
++            try:
++                return koji_cli.lib.watch_tasks(
++                    self.cmd.kojisession,
++                    task_ids,
++                    ki_handler=utils.make_koji_watch_tasks_handler(self.cmd.build_client)
++                )
++            except requests.exceptions.ConnectionError as e:
++                self.log.error('Could not finish the \'watch task\'. Reason: %s', e)
++                sys.exit(2)
+ 
+     def extract_greenwave_url(self):
+         greenwave_url = None
+-- 
+2.35.1
+

diff --git a/rpkg.spec b/rpkg.spec
index 30366ed..0213cb5 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
 Name:           rpkg
 Version:        1.64
-Release:        3%{?dist}
+Release:        4%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 License:        GPLv2+ and LGPLv2
@@ -38,6 +38,7 @@ Patch2:         0002-Remove-pytest-coverage-execution.patch
 Patch3:         0003-Remove-Environment-Markers-syntax.patch
 %endif
 Patch4:         0004-Add-custom-user-metadata-to-build-command.patch
+Patch5:         0005-Better-exit-code-for-connection-error.patch
 
 %description
 Python library for interacting with rpm+git
@@ -250,6 +251,9 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
 
 
 %changelog
+* Tue Apr 05 2022 Ondřej Nosek <onosek@redhat.com> - 1.64-4
+- Patch: Better exit code for connection error
+
 * Fri Mar 18 2022 Ondřej Nosek <onosek@redhat.com> - 1.64-3
 - Patch: Add `--custom-user-metadata` to build command
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-10 21:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 21:44 [rpms/rpkg] 1.70-1: Patch: Better exit code for connection error 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox