From 23f4b2a3ec9623d7460cfc82bab8fb34412dd703 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 29 May 2018 16:41:43 -0700 Subject: [PATCH] Fix make_dnf_dirs It was chopping off an extra directory level due to realpath removing the trailing / from the paths when they are setup. --- src/pylorax/api/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pylorax/api/config.py b/src/pylorax/api/config.py index db25983e..83ba203b 100644 --- a/src/pylorax/api/config.py +++ b/src/pylorax/api/config.py @@ -75,8 +75,11 @@ def make_dnf_dirs(conf): :returns: None """ for p in ["dnf_conf", "repo_dir", "cache_dir", "dnf_root"]: - p_dir = os.path.dirname(conf.get("composer", p)) - if not os.path.exists(p_dir): + p_dir = os.path.abspath(conf.get("composer", p)) + if p == "dnf_conf": + p_dir = os.path.dirname(p_dir) + + if not os.path.isdir(p_dir): os.makedirs(p_dir) def make_queue_dirs(conf, gid):