create ~/.weboob/backends with right permssions if it does not exist.
This commit is contained in:
parent
3d5d85e36b
commit
d61a9ad4d5
1 changed files with 8 additions and 4 deletions
|
|
@ -81,7 +81,11 @@ class BackendsConfig:
|
||||||
|
|
||||||
def __init__(self, confpath):
|
def __init__(self, confpath):
|
||||||
self.confpath = confpath
|
self.confpath = confpath
|
||||||
|
try:
|
||||||
mode = os.stat(confpath).st_mode
|
mode = os.stat(confpath).st_mode
|
||||||
|
except OSError:
|
||||||
|
os.mknod(confpath, 0600)
|
||||||
|
else:
|
||||||
if mode & stat.S_IRGRP or mode & stat.S_IROTH:
|
if mode & stat.S_IRGRP or mode & stat.S_IROTH:
|
||||||
raise self.WrongPermissions(
|
raise self.WrongPermissions(
|
||||||
u'Weboob will not start until config file %s is readable by group or other users.' % confpath)
|
u'Weboob will not start until config file %s is readable by group or other users.' % confpath)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue