- Msger can't show and recode stdout and stderr log of post script
because subprocess excuted post script with sys.stdout and sys.stderr.
Then mic get the log using subprocess pipe and show log using msger.
Signed-off-by: Yeongil Jang <yg0577.jang@samsung.com>
try:
try:
- subprocess.call([s.interp, script],
- preexec_fn = preexec,
- env = env,
- stdout = sys.stdout,
- stderr = sys.stderr)
+ p = subprocess.Popen([s.interp, script],
+ preexec_fn = preexec,
+ env = env,
+ stdout = subprocess.PIPE,
+ stderr = subprocess.STDOUT)
+ for entry in p.communicate()[0].splitlines():
+ msger.info(entry)
except OSError, (err, msg):
raise CreatorError("Failed to execute %%post script "
"with '%s' : %s" % (s.interp, msg))