From: Daniel Hokka Zakrisson Date: Wed, 1 Aug 2007 18:33:28 +0000 (+0000) Subject: Make sure the configuration directory exists and that it's usable X-Git-Tag: util-vserver-0.30.214-1~35 X-Git-Url: http://git.onelab.eu/?p=util-vserver.git;a=commitdiff_plain;h=91f3bf94636e7e3127c031640d8a51977045582f Make sure the configuration directory exists and that it's usable --- diff --git a/python/vserver.py b/python/vserver.py index cfd347c..93a22a2 100644 --- a/python/vserver.py +++ b/python/vserver.py @@ -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: