[FIX] prevent unneeded chmod datadir, but check writable

This commit is contained in:
Samus CTO 2015-02-27 17:16:16 +01:00
parent e6396deb4e
commit fb285d8695
1 changed files with 4 additions and 2 deletions

View File

@ -683,7 +683,8 @@ class configmanager(object):
if not os.path.exists(d): if not os.path.exists(d):
os.makedirs(d, 0700) os.makedirs(d, 0700)
else: else:
os.chmod(d, 0700) assert os.access(d, os.W_OK), \
"%s: directory is not writable" % d
return d return d
@property @property
@ -692,7 +693,8 @@ class configmanager(object):
if not os.path.exists(d): if not os.path.exists(d):
os.makedirs(d, 0700) os.makedirs(d, 0700)
else: else:
os.chmod(d, 0700) assert os.access(d, os.W_OK), \
"%s: directory is not writable" % d
return d return d
def filestore(self, dbname): def filestore(self, dbname):