[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Accept more zlib versions; stop giving incorrect warnin...



Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv20987/lib/mixminion/server

Modified Files:
	ServerMain.py 
Log Message:
Accept more zlib versions; stop giving incorrect warning when starting a server for the 1st time; document changes

Index: ServerMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerMain.py,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- ServerMain.py	8 Dec 2003 06:37:15 -0000	1.108
+++ ServerMain.py	14 Dec 2003 01:29:25 -0000	1.109
@@ -80,9 +80,11 @@
 
 def getHomedirVersion(config):
     """Return the version of the server's homedir.  If no version is found,
-       the version must be '1000'. """
+       the version must be '1000'.  If no directory structure is found,
+       returns None."""
     homeDir = config.getBaseDir()
     versionFile = os.path.join(homeDir, "version")
+    workDir = os.path.join(homeDir, "work")
     if not os.path.exists(homeDir):
         return None
     else:
@@ -90,8 +92,15 @@
             dirVersion = readFile(versionFile).strip()
         except (OSError, IOError), e:
             if e.errno == errno.ENOENT:
-                # The file doesn't exist; the version must be '1000'.
-                dirVersion = "1000"
+                if os.path.exists(workDir):
+                    # The file doesn't exist, but the 'work' subdirectory does:
+                    # the version must be '1000'.
+                    dirVersion = "1000"
+                else:
+                    # The version file doesn't exist, and neither does the 
+                    # 'work' subdirectory: There is no preexisting 
+                    # installation.
+                    dirVersion = None
             elif e.errno == errno.EACCES:
                 raise UIError("You don't have permission to read %s"%
                               versionFile)