Added a function to import site specific functions. Modified code to use it.
Signed-off-by: Mihai Rusu <dizzy@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2628 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/kernel.py b/client/bin/kernel.py
index 806bcb7..004f748 100755
--- a/client/bin/kernel.py
+++ b/client/bin/kernel.py
@@ -717,15 +717,15 @@
self.job.reboot(tag=self.installed_as)
+# just make the preprocessor a nop
+def _preprocess_path_dummy(path):
+ return path.strip()
+
+
# pull in some optional site-specific path pre-processing
-try:
- import site_kernel
- preprocess_path = site_kernel.preprocess_path
- del site_kernel
-except ImportError:
- # just make the preprocessor a nop
- def preprocess_path(path):
- return path.strip()
+preprocess_path = utils.import_site_function(__file__,
+ "autotest_lib.client.bin.site_kernel", "preprocess_path",
+ _preprocess_path_dummy)
def auto_kernel(job, path, subdir, tmp_dir, build_dir, leave=False):