Changeset 1960 for pykota/trunk/pykota/tool.py
- Timestamp:
- 11/27/04 23:52:07 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r1944 r1960 22 22 # 23 23 # $Log$ 24 # Revision 1.145 2004/11/27 22:52:07 jalet 25 # Now PyKota searches its configuration files first in system user pykota's 26 # home directory 27 # 24 28 # Revision 1.144 2004/11/18 06:01:53 jalet 25 29 # Fix for the fix … … 522 526 import sys 523 527 import os 528 import pwd 524 529 import fnmatch 525 530 import getopt … … 600 605 # pykota specific stuff 601 606 self.documentation = doc 607 608 # try to find the configuration files in user's 'pykota' home directory. 602 609 try : 603 self.config = config.PyKotaConfig("/etc/pykota") 610 pykotauser = pwd.getpwnam("pykota") 611 except KeyError : 612 confdir = "/etc/pykota" 613 missingUser = 1 614 else : 615 confdir = pykotauser[5] 616 missingUser = 0 617 618 try : 619 self.config = config.PyKotaConfig(confdir) 604 620 except ConfigParser.ParsingError, msg : 605 621 sys.stderr.write("ERROR: Problem encountered while parsing configuration file : %s\n" % msg) … … 615 631 self.crashed(msg) 616 632 raise 633 634 # We NEED this here, even when not in an accounting filter/backend 617 635 self.softwareJobSize = 0 618 636 self.softwareJobPrice = 0.0 637 619 638 if defaultToCLocale : 620 639 self.printInfo("Incorrect locale settings. PyKota falls back to the 'C' locale.", "warn") 640 if missingUser : 641 self.printInfo("The 'pykota' system account is missing. Configuration files were searched in /etc/pykota instead.", "warn") 642 621 643 self.logdebug("Charset in use : %s" % self.charset) 622 644 arguments = " ".join(['"%s"' % arg for arg in sys.argv])