mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 07:06:13 +01:00
Merge pull request #1077 from abitrolly/relconf
Fix failure to create config in current dir
This commit is contained in:
commit
4deaf2b9c3
@ -861,9 +861,10 @@ def write_config(fname, cp):
|
|||||||
fname = os.readlink(fname)
|
fname = os.readlink(fname)
|
||||||
|
|
||||||
# create directories to the config file (if they don't exist already)
|
# create directories to the config file (if they don't exist already)
|
||||||
if not os.path.exists(os.path.dirname(fname)):
|
fdir = os.path.dirname(fname)
|
||||||
|
if fdir:
|
||||||
try:
|
try:
|
||||||
os.makedirs(os.path.dirname(fname), mode=0o700)
|
os.makedirs(fdir, mode=0o700)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno != errno.EEXIST:
|
if e.errno != errno.EEXIST:
|
||||||
raise
|
raise
|
||||||
|
Loading…
Reference in New Issue
Block a user