From e2e1f48338c269e01999de88bf2cd9f91384d2b4 Mon Sep 17 00:00:00 2001
From: thijs snijder <snijder@astron.nl>
Date: Tue, 12 Apr 2022 14:14:02 +0200
Subject: [PATCH] organised snmp dev

---
 .../tangostationcontrol/devices/snmp_device.py           | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/devices/snmp_device.py b/tangostationcontrol/tangostationcontrol/devices/snmp_device.py
index 4bfbd9778..15ff0ca5e 100644
--- a/tangostationcontrol/tangostationcontrol/devices/snmp_device.py
+++ b/tangostationcontrol/tangostationcontrol/devices/snmp_device.py
@@ -112,11 +112,12 @@ class SNMP(lofar_device):
         # create the mib_loader
         loader = mib_loader()
 
-        # get the full mib directory adding the given relative path to the absolute path of this
-        if self.SNMP_rel_mib_dir[0] == "/":
-            mib_path = os.path.dirname(__file__) + self.SNMP_rel_mib_dir
-        else:
+        # if the string doesn't start with '/' it is a relative directory and we need to prepend the full path + '/'
+        if self.SNMP_rel_mib_dir[0] != "/":
             mib_path = os.path.dirname(__file__) + "/" + self.SNMP_rel_mib_dir
+        else:
+            # if the string does start with
+            mib_path = self.SNMP_rel_mib_dir
 
         # set the directory with the compiled mib files.
         loader.set_pymib_dir(mib_path)
-- 
GitLab