dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

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

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