Changeset 2829 for pykota/trunk/bin/cupspykota
- Timestamp:
- 04/04/06 11:16:53 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r2803 r2829 47 47 from pykota.accounter import openAccounter 48 48 from pykota.ipp import IPPRequest, IPPError 49 from pykota.storage import PyKotaStorageError50 49 51 50 class FakeObject : 51 """Fake object.""" 52 52 def __init__(self, name) : 53 53 """Fake init.""" … … 135 135 # see if the pid contained in the lock file is still running 136 136 os.kill(pid, 0) 137 except OSError, e :138 if e .errno != errno.EPERM :137 except OSError, err : 138 if err.errno != errno.EPERM : 139 139 # process doesn't exist anymore 140 140 os.remove(lockfilename) … … 318 318 self.regainPriv() 319 319 inputfile = os.popen(jobticketcommand, "r") 320 for line in inputfile.xreadlines() : 321 line = line.strip() 322 if line in ("DENY", "AUTH=NO", "AUTH=IMPOSSIBLE") : 323 self.logdebug("Seen %s command." % line) 324 action = "DENY" 325 elif line == "CANCEL" : 326 self.logdebug("Seen CANCEL command.") 327 action = "CANCEL" 328 elif line.startswith("USERNAME=") : 329 username = line.split("=", 1)[1].strip() 330 self.logdebug("Seen new username [%s]" % username) 331 elif line.startswith("BILLINGCODE=") : 332 billingcode = line.split("=", 1)[1].strip() 333 self.logdebug("Seen new billing code [%s]" % billingcode) 320 try : 321 for line in inputfile.xreadlines() : 322 line = line.strip() 323 if line in ("DENY", "AUTH=NO", "AUTH=IMPOSSIBLE") : 324 self.logdebug("Seen %s command." % line) 325 action = "DENY" 326 elif line == "CANCEL" : 327 self.logdebug("Seen CANCEL command.") 328 action = "CANCEL" 329 elif line.startswith("USERNAME=") : 330 username = line.split("=", 1)[1].strip() 331 self.logdebug("Seen new username [%s]" % username) 332 elif line.startswith("BILLINGCODE=") : 333 billingcode = line.split("=", 1)[1].strip() 334 self.logdebug("Seen new billing code [%s]" % billingcode) 335 except IOError, msg : 336 self.logdebug("IOError while reading subprocess' output : %s" % msg) 334 337 inputfile.close() 335 338 self.dropPriv() … … 452 455 453 456 class DummyClass : 457 """Class used to avoid errors.""" 454 458 operation_attributes = {} 455 459 job_attributes = {} … … 1254 1258 wrapper.printInfo(_("Job %s interrupted by the administrator !") % wrapper.JobId, "warn") 1255 1259 retcode = 0 1256 except SystemExit, e :1257 retcode = e .code1260 except SystemExit, err : 1261 retcode = err.code 1258 1262 except : 1259 1263 try :