aboutsummaryrefslogtreecommitdiff
path: root/scripts/utils.py
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-08-19 10:14:53 +0200
committerKarel Kočí <cynerd@email.cz>2015-08-19 10:19:06 +0200
commit11d45f70ceb41f7dfbf0ae337ebd0ed7a3a63090 (patch)
treedfb472cfdd8292b14a5276dbbcabe135a1f49f32 /scripts/utils.py
parent4c42daf1d4c2551b8d3e41f7bd6b90482900dad4 (diff)
downloadlinux-conf-perf-11d45f70ceb41f7dfbf0ae337ebd0ed7a3a63090.tar.gz
linux-conf-perf-11d45f70ceb41f7dfbf0ae337ebd0ed7a3a63090.tar.bz2
linux-conf-perf-11d45f70ceb41f7dfbf0ae337ebd0ed7a3a63090.zip
Store boot output to database
Because configuration is now stored in database only missing informations to make database fully descriptive is boot output. This makes output of boot command to be saved to database and not to file. Also parse script should read input from stdin and not from file from argument.
Diffstat (limited to 'scripts/utils.py')
-rw-r--r--scripts/utils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/utils.py b/scripts/utils.py
index 742aec5..e06bdbb 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -30,15 +30,18 @@ def build_symbol_map():
def callsubprocess(process_name, process, show_output = True,
return_output = False, env=os.environ, allowed_exit_codes = [0],
- allow_all_exit_codes = False):
+ allow_all_exit_codes = False, stdin = None):
sprc = subprocess.Popen(process, stdout = subprocess.PIPE,
- stderr = subprocess.STDOUT, env = env)
+ stderr = subprocess.STDOUT, stdin = subprocess.PIPE, env = env)
try:
os.mkdir(os.path.join(sf(conf.log_folder), process_name))
except OSError:
pass
+ if stdin != None:
+ sprc.stdin.write(bytes(stdin, sys.getdefaultencoding()))
+
rtn = []
with open(os.path.join(sf(conf.log_folder),
process_name, time.strftime("%y-%m-%d-%H-%M-%S") + ".log"),