Create parent directories for logfiles if they do not exist. --- iutil.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/iutil.py b/iutil.py index a568ff7..d0f6212 100644 --- a/iutil.py +++ b/iutil.py @@ -93,6 +93,9 @@ def execWithRedirect(command, argv, stdin = None, stdout = None, stdin = sys.stdin.fileno() if isinstance(stdout, str): + dn = os.path.dirname(os.path.realpath(stdout)) + if not os.path.isdir(dn): + os.makedirs(dn) stdout = os.open(stdout, os.O_RDWR|os.O_CREAT) stdoutclose = lambda : os.close(stdout) elif isinstance(stdout, int): -- 1.7.0.1 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list