Make sure the configuration directory exists and that it's usable
Daniel Hokka Zakrisson [Wed, 1 Aug 2007 18:33:28 +0000 (18:33 +0000)]
python/vserver.py

index cfd347c..93a22a2 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 2005 Princeton University
 
-#$Id: vserver.py,v 1.67 2007/07/31 18:14:02 dhozac Exp $
+#$Id: vserver.py,v 1.68 2007/07/31 22:04:24 dhozac Exp $
 
 import errno
 import fcntl
@@ -61,6 +61,9 @@ class VServerConfig:
     def __init__(self, name, directory):
         self.name = name
         self.dir = directory
+        if not (os.path.isdir(self.dir) and
+                os.access(self.dir, os.R_OK | os.W_OK | os.X_OK):
+            raise NoSuchVServer, "%s does not exist" % self.dir
 
     def get(self, option, default = None):
         try: