return error when dnf download failed

This commit is contained in:
shirely16 2021-04-16 09:13:01 +08:00
parent 55aaf161c4
commit 334d7a9eb7
2 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,31 @@
From 86b479d618c6ec7cace7ba8f0e53e4a05cdb59d9 Mon Sep 17 00:00:00 2001
From: zhangrui182 <55428730+zhangrui182@users.noreply.github.com>
Date: Wed, 15 Jul 2020 10:41:18 +0800
Subject: [PATCH] return error when dnf download failed
fix RhBug:1844925: https://bugzilla.redhat.com/show_bug.cgi?id=1844925
Conflict:NA
Reference:https://github.com/rpm-software-management/dnf-plugins-core/commit/86b479d618c6ec7cace7ba8f0e53e4a05cdb59d9
---
plugins/download.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/download.py b/plugins/download.py
index c0fc213d..92a6df4a 100644
--- a/plugins/download.py
+++ b/plugins/download.py
@@ -259,9 +259,9 @@ def _get_packages_with_deps(self, pkg_specs, source=False):
pkg_set.update(goal.list_upgrades())
else:
msg = [_('Error in resolve of packages:')]
- logger.warning("\n ".join(msg + [str(pkg) for pkg in pkgs]))
- logger.warning(dnf.util._format_resolve_problems(goal.problem_rules()))
- return []
+ logger.error("\n ".join(msg + [str(pkg) for pkg in pkgs]))
+ logger.error(dnf.util._format_resolve_problems(goal.problem_rules()))
+ raise dnf.exceptions.Error()
return pkg_set
@staticmethod

View File

@ -7,11 +7,14 @@
Name: dnf-plugins-core
Version: 4.0.17
Release: 1
Release: 2
Summary: Core Plugins for DNF
License: GPLv2+
URL: https://github.com/rpm-software-management/dnf-plugins-core
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch6000: backport-Return-error-when-dnf-download-failed.patch
BuildArch: noarch
BuildRequires: cmake gettext python3-sphinx gdb
Requires: python3-%{name} = %{version}-%{release}
@ -148,7 +151,7 @@ on the local filesystem and generating repo metadata.
%package_help
%prep
%autosetup
%autosetup -p1
mkdir build-py3
%build
@ -314,6 +317,12 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
%{_mandir}/man8/dnf-local.*
%changelog
* Fri Apr 16 2021 hanhui <hanhui15@huawei.com> - 4.0.17-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:return error when dnf download failed
* Tue Apr 28 2020 zhouyihang <zhouyihang3@huawei.com> - 4.0.17-1
- Type:requirement
- ID:NA