diff --git a/osc/conf.py b/osc/conf.py index 882d06d0..6d8cc1cb 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -861,9 +861,10 @@ def write_config(fname, cp): fname = os.readlink(fname) # 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: - os.makedirs(os.path.dirname(fname), mode=0o700) + os.makedirs(fdir, mode=0o700) except OSError as e: if e.errno != errno.EEXIST: raise