From bb1c556cc4e502c9a3465d491a7368740d599a09 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Wed, 11 May 2016 13:47:32 -0700 Subject: [PATCH] Better error handling for failed connections Export debug and verbosity settings --- .../src/python/onl/install/App.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/App.py b/packages/base/all/vendor-config-onl/src/python/onl/install/App.py index 65968f4c..ad98eb1a 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/App.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/App.py @@ -21,7 +21,9 @@ import ConfUtils, BaseInstall class App(SubprocessMixin): - def __init__(self, url=None, force=False, log=None): + def __init__(self, url=None, + debug=False, force=False, + log=None): if log is not None: self.log = log @@ -30,6 +32,7 @@ class App(SubprocessMixin): self.url = url self.force = force + self.debug = debug # remote-install mode self.installer = None @@ -98,6 +101,15 @@ class App(SubprocessMixin): env['SFX_INPLACE'] = '1' self.log.debug("+ export SFX_INPLACE=1") + if self.debug: + self.log.debug("enabling installer debug") + env['installer_debug'] = 'y' + self.log.debug("+ export installer_debug=y") + if self.log.level < logging.INFO: + self.log.debug("enabling installer verbose logging") + env['installer_verbose'] = 'y' + self.log.debug("+ export installer_verbose=y") + self.log.info("invoking installer...") try: self.check_call((p,), env=env) @@ -105,7 +117,8 @@ class App(SubprocessMixin): self.log.error("installer failed") return ex.returncode finally: - os.unlink(p) + if os.path.exists(p): + os.unlink(p) self.log.info("please reboot this system now.") return 0