aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-03-22 23:00:46 +0100
committerKarel Kočí <cynerd@email.cz>2015-03-22 23:00:46 +0100
commit3c57780436353267bab05a5b26d355c6308b43d7 (patch)
treedc57d796a19dcd5858a692e7d470879f300f9bb1
parent142cda87246f3282b32ddea3e5ea579aef98ef59 (diff)
downloadlinux-conf-perf-3c57780436353267bab05a5b26d355c6308b43d7.tar.gz
linux-conf-perf-3c57780436353267bab05a5b26d355c6308b43d7.tar.bz2
linux-conf-perf-3c57780436353267bab05a5b26d355c6308b43d7.zip
Kernel configuration is now throwing exception on failure
-rw-r--r--scripts/exceptions.py6
-rw-r--r--scripts/kernel.py9
2 files changed, 11 insertions, 4 deletions
diff --git a/scripts/exceptions.py b/scripts/exceptions.py
index 722c44a..68fef59 100644
--- a/scripts/exceptions.py
+++ b/scripts/exceptions.py
@@ -19,3 +19,9 @@ class PhaseMismatch(Exception):
pass
def __str__(self):
return "Phase in " + conf.phase_file + " is unknown."
+
+class KernelConfigFailed(Exception):
+ def __init__(self):
+ pass
+ def __str__(self):
+ return "Kernel configuration failed."
diff --git a/scripts/kernel.py b/scripts/kernel.py
index 51c5b21..76255d0 100644
--- a/scripts/kernel.py
+++ b/scripts/kernel.py
@@ -2,9 +2,9 @@ import os
import sys
import subprocess
-import utils
from conf import conf
-
+import utils
+from exceptions import KernelConfigFailed
def config():
# Executing old linux config
@@ -16,11 +16,12 @@ def config():
line = sprc.stdout.readline()
if line != '':
if b'Restart config' in line:
- print("Kernel config failed")
sprc.terminate()
+ raise KernelConfigFailed()
break
else:
- print(line.decode('utf-8'), end="")
+ if conf.kernel_config_output:
+ print(line.decode('utf-8'), end="")
else:
break
os.chdir(wd)