# HG changeset patch # User paulb # Date 1126298845 0 # Node ID 881b64c7d4dd7bf3503bbb0bda0b19cc4b704df3 # Parent 094c5fe5d871202d9055a529ee643bd1e4be7df3 [project @ 2005-09-09 20:47:25 by paulb] Updated the Apache configuration tool to avoid asking about the session directory when it does not exist. diff -r 094c5fe5d871 -r 881b64c7d4dd tools/Apache/config.py --- a/tools/Apache/config.py Tue Sep 06 23:02:21 2005 +0000 +++ b/tools/Apache/config.py Fri Sep 09 20:47:25 2005 +0000 @@ -146,27 +146,28 @@ # Find the user who should own the sessions directory. - try: - import pwd - username = apache_server.get_user_from_config() - if username is None: - print "Not able to determine the Web server user." - else: - print "Found", username, "as the Web server user." - try: - t = pwd.getpwnam(username) - uid, gid = t[2:4] - answer = raw_input("Set %s, %s as user, group on the sessions directory? (Y|N) " % (uid, gid)) - if answer.upper() == "Y": - os.chown(sessions_dir, uid, gid) + if os.path.exists(sessions_dir): + try: + import pwd + username = apache_server.get_user_from_config() + if username is None: + print "Not able to determine the Web server user." + else: + print "Found", username, "as the Web server user." + try: + t = pwd.getpwnam(username) + uid, gid = t[2:4] + answer = raw_input("Set %s, %s as user, group on the sessions directory? (Y|N) " % (uid, gid)) + if answer.upper() == "Y": + os.chown(sessions_dir, uid, gid) - except KeyError: - print "User not found in the password database." - except OSError: - print "Not able to change the ownership. Check your user privileges." + except KeyError: + print "User not found in the password database." + except OSError: + print "Not able to change the ownership. Check your user privileges." - except ImportError: - print "Not configuring the sessions directory ownership." + except ImportError: + print "Not configuring the sessions directory ownership." # Check the permissions on the application.