public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Patch: Better exit code for connection error
Date: Mon, 10 Aug 2026 21:44:26 GMT [thread overview]
Message-ID: <178639826626.1.17808690570481496814.rpms-rpkg-b30484594b5a@fedoraproject.org> (raw)
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
reply other threads:[~2026-08-10 21:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178639826626.1.17808690570481496814.rpms-rpkg-b30484594b5a@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox