Changeset 1740 for pykota/trunk/bin
- Timestamp:
- 09/23/04 21:29:36 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkhint
r1652 r1740 24 24 # 25 25 # $Log$ 26 # Revision 1.17 2004/09/23 19:29:36 jalet 27 # If SNMP accounting is possible, pkhint now suggests to use the internal 28 # SNMP handling instead of the external one. No real test is done for now, 29 # though. 30 # 26 31 # Revision 1.16 2004/07/27 21:50:29 jalet 27 32 # Small fix for %(port)s thanks to rpinheiro … … 86 91 from pykota.config import PyKotaConfigError 87 92 from pykota.storage import PyKotaStorageError 93 try : 94 import pysnmp 95 except ImportError : 96 hasSNMP = 0 97 else : 98 hasSNMP = 1 88 99 89 100 __doc__ = """pkhint v%s (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres … … 246 257 port = 9100 # TODO : may cause problems with other protocols. 247 258 259 248 260 snmpcommand = self.accepts(SNMPTESTS, hostname) 249 261 if snmpcommand is not None : 250 accounter = 'hardware(/usr/share/pykota/waitprinter.sh %(printer)s && ' + snmpcommand + ')' 262 if hasSNMP : 263 # don't do a more complex test, just consider it will work 264 accounter = 'hardware(snmp)' 265 else : 266 accounter = 'hardware(/usr/share/pykota/waitprinter.sh %(printer)s && ' + snmpcommand + ')' 251 267 configuration.append((printer, accounter)) 252 268 else :