Blame SOURCES/bz1367808-01-fix-formating-of-assertion-error-in-snmp.patch

a3a2ad
From b1c3a422b55f27cb6bc7b60b89a0c929eff0a030 Mon Sep 17 00:00:00 2001
a3a2ad
From: Ondrej Mular <omular@redhat.com>
a3a2ad
Date: Tue, 21 Nov 2017 12:07:43 +0100
a3a2ad
Subject: [PATCH] fix formating of assertion error in snmp
a3a2ad
a3a2ad
---
a3a2ad
 pcs/snmp/agentx/updater.py | 4 ++--
a3a2ad
 1 file changed, 2 insertions(+), 2 deletions(-)
a3a2ad
a3a2ad
diff --git a/pcs/snmp/agentx/updater.py b/pcs/snmp/agentx/updater.py
a3a2ad
index 7ac20ae..c63f96b 100644
a3a2ad
--- a/pcs/snmp/agentx/updater.py
a3a2ad
+++ b/pcs/snmp/agentx/updater.py
a3a2ad
@@ -82,8 +82,8 @@ def _str_oid_to_oid(sub_tree, str_oid):
a3a2ad
         sub_tree = _find_oid_in_sub_tree(sub_tree, section)
a3a2ad
         if sub_tree is None:
a3a2ad
             raise AssertionError(
a3a2ad
-                "oid section {0} ({1}) not found in {1} ({2})".format(
a3a2ad
-                    section, str_oid, sub_tree.str_oid
a3a2ad
+                "oid section '{0}' ({1}) not found in section '{2}'".format(
a3a2ad
+                    section, str_oid, oid_list[-1] if len(oid_list) else "."
a3a2ad
                 )
a3a2ad
             )
a3a2ad
         oid_list.append(str(sub_tree.oid))
a3a2ad
-- 
a3a2ad
1.8.3.1
a3a2ad