diff options
author | jianzhong.fang <jz.fang@samsung.com> | 2016-03-17 10:34:48 +0800 |
---|---|---|
committer | jianzhong.fang <jz.fang@samsung.com> | 2016-03-17 10:35:13 +0800 |
commit | 7656d8beb8efa9d4b867522d4d6387833f8f92fd (patch) | |
tree | 1fc189b68be3c2cf49ab67fa8b358ec43dc62593 | |
parent | 2ba8076582cabe48b38372baebcc677ab5e7de94 (diff) | |
download | mic-7656d8beb8efa9d4b867522d4d6387833f8f92fd.tar.gz mic-7656d8beb8efa9d4b867522d4d6387833f8f92fd.tar.bz2 mic-7656d8beb8efa9d4b867522d4d6387833f8f92fd.zip |
check scriptlet error file on /tmp/.postscript/error/
Change-Id: I26c09e1bfc2c7ef9090b8e9218ce06880072398a
-rw-r--r-- | mic/imager/baseimager.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mic/imager/baseimager.py b/mic/imager/baseimager.py index 81ce9f4..01936a1 100644 --- a/mic/imager/baseimager.py +++ b/mic/imager/baseimager.py @@ -993,6 +993,18 @@ class BaseImageCreator(object): the kickstart to be overridden. """ + def checkScriptletError(dirname, suffix): + if os.path.exists(dirname): + list = os.listdir(dirname) + for line in list: + filepath = os.path.join(dirname, line) + if os.path.isfile(filepath) and 0 < line.find(suffix): + return True + else: + continue + + return False + def get_ssl_verify(ssl_verify=None): if ssl_verify is not None: return not ssl_verify.lower().strip() == 'no' @@ -1073,6 +1085,9 @@ class BaseImageCreator(object): finally: pkg_manager.close() + if checkScriptletError(self._instroot + "/tmp/.postscript/error/", "_error"): + raise CreatorError('scriptlet errors occurred') + # hook post install self.postinstall() |