Changeset 1517 for pykota/trunk/bin
- Timestamp:
- 06/03/04 23:50:34 (20 years ago)
- Location:
- pykota/trunk/bin
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r1515 r1517 24 24 # 25 25 # $Log$ 26 # Revision 1.58 2004/06/03 21:50:33 jalet 27 # Improved error logging. 28 # crashrecipient directive added. 29 # Now exports the job's size in bytes too. 30 # 26 31 # Revision 1.57 2004/06/02 22:18:07 jalet 27 32 # I think the bug when cancelling jobs should be fixed right now … … 330 335 clienthost = self.getJobOriginatingHostname(printer.Name, user.Name, self.jobid) 331 336 self.logdebug("Client Hostname : %s" % (clienthost or "Unknown")) 332 os. putenv("PYKOTAJOBORIGINATINGHOSTNAME", str(clienthost or ""))337 os.environ["PYKOTAJOBORIGINATINGHOSTNAME"] = str(clienthost or "") 333 338 334 339 # enters first phase 335 os. putenv("PYKOTAPHASE", "BEFORE")340 os.environ["PYKOTAPHASE"] = "BEFORE" 336 341 337 342 # checks the user's quota … … 340 345 self.softwareJobPrice = userpquota.computeJobPrice(self.softwareJobSize) 341 346 self.logdebug("Precomputed job's size is %s pages, price is %s units" % (self.softwareJobSize, self.softwareJobPrice)) 342 os. putenv("PYKOTAPRECOMPUTEDJOBSIZE", str(self.softwareJobSize))343 os. putenv("PYKOTAPRECOMPUTEDJOBPRICE", str(self.softwareJobPrice))347 os.environ["PYKOTAPRECOMPUTEDJOBSIZE"] = str(self.softwareJobSize) 348 os.environ["PYKOTAPRECOMPUTEDJOBPRICE"] = str(self.softwareJobPrice) 344 349 action = self.warnUserPQuota(userpquota) 345 350 346 351 # exports some new environment variables 347 os. putenv("PYKOTAACTION", action)352 os.environ["PYKOTAACTION"] = action 348 353 349 354 # launches the pre hook … … 354 359 else : 355 360 action = "ALLOW" 356 os. putenv("PYKOTAACTION", action)361 os.environ["PYKOTAACTION"] = action 357 362 358 363 # pass the job's data to the real backend … … 367 372 if policy == "OK" : 368 373 # indicate phase change 369 os. putenv("PYKOTAPHASE", "AFTER")374 os.environ["PYKOTAPHASE"] = "AFTER" 370 375 371 376 # stops accounting. … … 390 395 391 396 # exports some new environment variables 392 os. putenv("PYKOTAJOBSIZE", str(jobsize))393 os. putenv("PYKOTAJOBPRICE", str(jobprice))394 395 # then re-export user information with new value s397 os.environ["PYKOTAJOBSIZE"] = str(jobsize) 398 os.environ["PYKOTAJOBPRICE"] = str(jobprice) 399 400 # then re-export user information with new value 396 401 self.exportUserInfo(userpquota) 397 402 … … 660 665 retcode = kotabackend.mainWork() 661 666 except : 662 import traceback 663 lines = [] 664 for line in traceback.format_exception(*sys.exc_info()) : 665 lines.extend([l for l in line.split("\n") if l]) 666 sys.stderr.write("ERROR : cupspykota backend failed : \n%s" % (msg, "ERROR : ".join(["%s\n" % l for l in lines]))) 667 sys.stderr.flush() 667 try : 668 kotabackend.crashed("cupspykota backend failed") 669 except : 670 pass 668 671 retcode = 1 669 672 -
pykota/trunk/bin/edpykota
r1436 r1517 24 24 # 25 25 # $Log$ 26 # Revision 1.73 2004/06/03 21:50:34 jalet 27 # Improved error logging. 28 # crashrecipient directive added. 29 # Now exports the job's size in bytes too. 30 # 26 31 # Revision 1.72 2004/04/16 16:20:19 jalet 27 32 # Note about not implemented limitby values … … 690 695 else : 691 696 retcode = editor.main(args, options) 692 except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError), msg : 693 sys.stderr.write("%s\n" % msg) 694 sys.stderr.flush() 697 except : 698 try : 699 editor.crashed("edpykota failed") 700 except : 701 pass 695 702 retcode = -1 696 703 -
pykota/trunk/bin/pkhint
r1483 r1517 24 24 # 25 25 # $Log$ 26 # Revision 1.9 2004/06/03 21:50:34 jalet 27 # Improved error logging. 28 # crashrecipient directive added. 29 # Now exports the job's size in bytes too. 30 # 26 31 # Revision 1.8 2004/05/18 14:48:47 jalet 27 32 # Big code changes to completely remove the need for "requester" directives, … … 266 271 args = [ "*" ] 267 272 retcode = manager.main(args, options) 268 except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError), msg : 269 sys.stderr.write("%s\n" % msg) 270 sys.stderr.flush() 273 except : 274 try : 275 manager.crashed("pkhint failed") 276 except : 277 pass 271 278 retcode = -1 272 279 -
pykota/trunk/bin/pkprinters
r1453 r1517 24 24 # 25 25 # $Log$ 26 # Revision 1.9 2004/06/03 21:50:34 jalet 27 # Improved error logging. 28 # crashrecipient directive added. 29 # Now exports the job's size in bytes too. 30 # 26 31 # Revision 1.8 2004/05/06 20:30:24 jalet 27 32 # Added --skipexisting command line option to pkprinters … … 255 260 else : 256 261 retcode = manager.main(args, options) 257 except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError), msg : 258 sys.stderr.write("%s\n" % msg) 259 sys.stderr.flush() 262 except : 263 try : 264 manager.crashed("pkprinters failed") 265 except : 266 pass 260 267 retcode = -1 261 268 -
pykota/trunk/bin/pykotme
r1488 r1517 24 24 # 25 25 # $Log$ 26 # Revision 1.10 2004/06/03 21:50:34 jalet 27 # Improved error logging. 28 # crashrecipient directive added. 29 # Now exports the job's size in bytes too. 30 # 26 31 # Revision 1.9 2004/05/21 20:53:34 jalet 27 32 # Now pykotme doesn't spawn a new process anymore to compute job's size, but … … 186 191 else : 187 192 retcode = sender.main(args, options) 188 except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError), msg : 189 sys.stderr.write("%s\n" % msg) 190 sys.stderr.flush() 193 except : 194 try : 195 sender.crashed("pykotme failed") 196 except : 197 pass 191 198 retcode = -1 192 199 -
pykota/trunk/bin/repykota
r1257 r1517 24 24 # 25 25 # $Log$ 26 # Revision 1.47 2004/06/03 21:50:34 jalet 27 # Improved error logging. 28 # crashrecipient directive added. 29 # Now exports the job's size in bytes too. 30 # 26 31 # Revision 1.46 2004/01/08 14:10:32 jalet 27 32 # Copyright year changed. … … 307 312 else : 308 313 retcode = reportTool.main(args, options) 309 except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaReporterError), msg : 310 sys.stderr.write("%s\n" % msg) 311 sys.stderr.flush() 312 retcode = -1 314 except : 315 try : 316 reportTool.crashed("repykota failed") 317 except : 318 pass 319 retcode = -1 313 320 314 321 try : -
pykota/trunk/bin/warnpykota
r1257 r1517 24 24 # 25 25 # $Log$ 26 # Revision 1.27 2004/06/03 21:50:34 jalet 27 # Improved error logging. 28 # crashrecipient directive added. 29 # Now exports the job's size in bytes too. 30 # 26 31 # Revision 1.26 2004/01/08 14:10:32 jalet 27 32 # Copyright year changed. … … 247 252 else : 248 253 retcode = sender.main(args, options) 249 except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError), msg : 250 sys.stderr.write("%s\n" % msg) 251 sys.stderr.flush() 254 except : 255 try : 256 sender.crashed("warnpykota failed") 257 except : 258 pass 252 259 retcode = -1 253 260