Commits

elie  committed ae71ab0

pretty print contextEngineId in debug

  • Participants
  • Parent commits b3b7e9b

Comments (0)

Files changed (1)

File pysnmp/entity/rfc3413/context.py

             raise error.PySnmpError(
                 'Duplicate contextName %s' % contextName
                 )
-        debug.logger & debug.flagIns and debug.logger('registerContextName: registered contextName \"%s\", mibInstrum %s' % (contextName, mibInstrum))
+        debug.logger & debug.flagIns and debug.logger('registerContextName: registered contextName %r, mibInstrum %r' % (contextName, mibInstrum))
         if mibInstrum is None:
             self.contextNames[contextName] = self.contextNames[null]
         else:
     def unregisterContextName(self, contextName):
         contextName = univ.OctetString(contextName).asOctets()
         if contextName in self.contextNames:
-            debug.logger & debug.flagIns and debug.logger('unregisterContextName: unregistered contextName \"%s\"' % contextName)
+            debug.logger & debug.flagIns and debug.logger('unregisterContextName: unregistered contextName %r' % contextName)
             del self.contextNames[contextName]
 
     def getMibInstrum(self, contextName=null):
         contextName = univ.OctetString(contextName).asOctets()
         if contextName not in self.contextNames:
-            debug.logger & debug.flagIns and debug.logger('getMibInstrum: contextName \"%s\" not registered' % contextName)
+            debug.logger & debug.flagIns and debug.logger('getMibInstrum: contextName %r not registered' % contextName)
             raise error.PySnmpError(
                 'Missing contextName %s' % contextName
                 )
         else:
-            debug.logger & debug.flagIns and debug.logger('getMibInstrum: contextName \"%s\", mibInstum %s' % (contextName, self.contextNames[contextName]))
+            debug.logger & debug.flagIns and debug.logger('getMibInstrum: contextName %r, mibInstum %r' % (contextName, self.contextNames[contextName]))
             return self.contextNames[contextName]