dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0035-Do-not-print-errors-on-failovermethod-repo-option-Rh.patch

1a8671
From c4ee580c73375060b6eb5b3414636688e3d601c3 Mon Sep 17 00:00:00 2001
1a8671
From: Marek Blaha <mblaha@redhat.com>
1a8671
Date: Fri, 10 Jun 2022 15:29:56 +0200
1a8671
Subject: [PATCH] Do not print errors on failovermethod repo option
1a8671
 (RhBug:2039906)
1a8671
1a8671
= changelog =
1a8671
msg:           Do not print errors if repository config contains failovermethod option
1a8671
type:          bugfix
1a8671
resolves:      https://bugzilla.redhat.com/show_bug.cgi?id=2039906
1a8671
---
1a8671
 libdnf/conf/ConfigRepo.cpp | 10 ++++++++++
1a8671
 1 file changed, 10 insertions(+)
1a8671
1a8671
diff --git a/libdnf/conf/ConfigRepo.cpp b/libdnf/conf/ConfigRepo.cpp
1a8671
index e98ac0af..0cb52f58 100644
1a8671
--- a/libdnf/conf/ConfigRepo.cpp
1a8671
+++ b/libdnf/conf/ConfigRepo.cpp
1a8671
@@ -22,6 +22,8 @@
1a8671
 #include "Const.hpp"
1a8671
 #include "Config-private.hpp"
1a8671
 
1a8671
+#include "bgettext/bgettext-lib.h"
1a8671
+
1a8671
 namespace libdnf {
1a8671
 
1a8671
 class ConfigRepo::Impl {
1a8671
@@ -174,6 +176,14 @@ ConfigRepo::Impl::Impl(Config & owner, ConfigMain & mainConfig)
1a8671
     owner.optBinds().add("enabled_metadata", enabled_metadata);
1a8671
     owner.optBinds().add("user_agent", user_agent);
1a8671
     owner.optBinds().add("countme", countme);
1a8671
+    owner.optBinds().add("failovermethod", failovermethod,
1a8671
+        [&](Option::Priority priority, const std::string & value){
1a8671
+            if (value != "priority") {
1a8671
+                throw Option::InvalidValue(_("only the value 'priority' is supported."));
1a8671
+            }
1a8671
+            failovermethod.set(priority, value);
1a8671
+        }, nullptr, false
1a8671
+    );
1a8671
     owner.optBinds().add("sslverifystatus", sslverifystatus);
1a8671
 }
1a8671
 
1a8671
-- 
1a8671
2.36.1
1a8671