diff options
author | Ilya Etingof <etingof@gmail.com> | 2019-02-10 16:38:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-10 16:38:35 +0100 |
commit | 588b9b902d191d8010cb6b247fcb07887d59542c (patch) | |
tree | 419b01d2598e91331db784ac3a6675324aba8c24 /pysnmp/entity/rfc3413/context.py | |
parent | 9664858b145140a4fbb2a22b633c1ab41c2555bd (diff) | |
download | pysnmp-git-588b9b902d191d8010cb6b247fcb07887d59542c.tar.gz |
Uppercase global constants (#238)
This is a massive patch essentially upper-casing global/class attributes
that mean to be constants.
Some previously exposed constants have been preserved for compatibility
reasons (notably, in `hlapi`), though the rest might break user code relying
on pysnmp 4.
Diffstat (limited to 'pysnmp/entity/rfc3413/context.py')
-rw-r--r-- | pysnmp/entity/rfc3413/context.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pysnmp/entity/rfc3413/context.py b/pysnmp/entity/rfc3413/context.py index 3975e670..7d3c3262 100644 --- a/pysnmp/entity/rfc3413/context.py +++ b/pysnmp/entity/rfc3413/context.py @@ -19,7 +19,7 @@ class SnmpContext(object): self.contextEngineId = snmpEngineId.syntax else: self.contextEngineId = snmpEngineId.syntax.clone(contextEngineId) - debug.logger & debug.flagIns and debug.logger('SnmpContext: contextEngineId \"%r\"' % (self.contextEngineId,)) + debug.logger & debug.FLAG_INS and debug.logger('SnmpContext: contextEngineId \"%r\"' % (self.contextEngineId,)) self.contextNames = { null: snmpEngine.msgAndPduDsp.mibInstrumController # Default name } @@ -30,7 +30,7 @@ class SnmpContext(object): raise error.PySnmpError( 'Duplicate contextName %s' % contextName ) - debug.logger & debug.flagIns and debug.logger( + debug.logger & debug.FLAG_INS and debug.logger( 'registerContextName: registered contextName %r, mibInstrum %r' % (contextName, mibInstrum)) if mibInstrum is None: self.contextNames[contextName] = self.contextNames[null] @@ -40,18 +40,18 @@ class SnmpContext(object): def unregisterContextName(self, contextName): contextName = univ.OctetString(contextName).asOctets() if contextName in self.contextNames: - debug.logger & debug.flagIns and debug.logger( + debug.logger & debug.FLAG_INS 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 %r not registered' % contextName) + debug.logger & debug.FLAG_INS and debug.logger('getMibInstrum: contextName %r not registered' % contextName) raise error.PySnmpError( 'Missing contextName %s' % contextName ) else: - debug.logger & debug.flagIns and debug.logger( + debug.logger & debug.FLAG_INS and debug.logger( 'getMibInstrum: contextName %r, mibInstum %r' % (contextName, self.contextNames[contextName])) return self.contextNames[contextName] |