[PATCH 1/4] Make parent directories for ks scriptlet log files (#597279)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux