Blob Blame History Raw
From b1c3a422b55f27cb6bc7b60b89a0c929eff0a030 Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Tue, 21 Nov 2017 12:07:43 +0100
Subject: [PATCH] fix formating of assertion error in snmp

---
 pcs/snmp/agentx/updater.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pcs/snmp/agentx/updater.py b/pcs/snmp/agentx/updater.py
index 7ac20ae..c63f96b 100644
--- a/pcs/snmp/agentx/updater.py
+++ b/pcs/snmp/agentx/updater.py
@@ -82,8 +82,8 @@ def _str_oid_to_oid(sub_tree, str_oid):
         sub_tree = _find_oid_in_sub_tree(sub_tree, section)
         if sub_tree is None:
             raise AssertionError(
-                "oid section {0} ({1}) not found in {1} ({2})".format(
-                    section, str_oid, sub_tree.str_oid
+                "oid section '{0}' ({1}) not found in section '{2}'".format(
+                    section, str_oid, oid_list[-1] if len(oid_list) else "."
                 )
             )
         oid_list.append(str(sub_tree.oid))
-- 
1.8.3.1