diff --git a/tangostationcontrol/tangostationcontrol/devices/snmp_device.py b/tangostationcontrol/tangostationcontrol/devices/snmp_device.py index 4bfbd9778725df60b52b21767c0495fe66a5f3a9..15ff0ca5e4b2e4c1b3558f217909558d15116e8d 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)