[PATCH] stdout and stderr may also need to be created.

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

 



This is required when handling kickstart scriptlets that can write to
log files, since the log file will need to be created before it can
be opened.
---
 iutil.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/iutil.py b/iutil.py
index a508219..d9e8a77 100644
--- a/iutil.py
+++ b/iutil.py
@@ -65,14 +65,14 @@ def execWithRedirect(command, argv, stdin = None, stdout = None,
         stdin = sys.stdin.fileno()
 
     if isinstance(stdout, str):
-        stdout = os.open(stdout, os.O_RDWR)
+        stdout = os.open(stdout, os.O_RDWR|os.O_CREAT)
     elif isinstance(stdout, int):
         pass
     elif stdout is None or not isinstance(stdout, file):
         stdout = sys.stdout.fileno()
 
     if isinstance(stderr, str):
-        stderr = os.open(stderr, os.O_RDWR)
+        stderr = os.open(stderr, os.O_RDWR|os.O_CREAT)
     elif isinstance(stderr, int):
         pass
     elif stderr is None or not isinstance(stderr, file):
@@ -135,7 +135,7 @@ def execWithCapture(command, argv, stdin = None, stderr = None, root='/'):
         stdin = sys.stdin.fileno()
 
     if isinstance(stderr, str):
-        stderr = os.open(stderr, os.O_RDWR)
+        stderr = os.open(stderr, os.O_RDWR|os.O_CREAT)
     elif isinstance(stderr, int):
         pass
     elif stderr is None or not isinstance(stderr, file):
@@ -184,14 +184,14 @@ def execWithPulseProgress(command, argv, stdin = None, stdout = None,
         stdin = sys.stdin.fileno()
 
     if isinstance(stdout, str):
-        stdout = os.open(stdout, os.O_RDWR)
+        stdout = os.open(stdout, os.O_RDWR|os.O_CREAT)
     elif isinstance(stdout, int):
         pass
     elif stdout is None or not isinstance(stdout, file):
         stdout = sys.stdout.fileno()
 
     if isinstance(stderr, str):
-        stderr = os.open(stderr, os.O_RDWR)
+        stderr = os.open(stderr, os.O_RDWR|os.O_CREAT)
     elif isinstance(stderr, int):
         pass
     elif stderr is None or not isinstance(stderr, file):
-- 
1.6.1.3

_______________________________________________
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