7084504 AI should report IPS errors to the tty/console
authorDarren Kenny <Darren.Kenny@Oracle.COM>
Wed, 31 Aug 2011 08:40:53 -0700
changeset 1437 4d1bbd9d1aa4
parent 1436 5cf488252cbc
child 1438 30d10e4731d5
7084504 AI should report IPS errors to the tty/console 7041581 Install Engine should be called with debug=False
usr/src/cmd/auto-install/auto_install.py
--- a/usr/src/cmd/auto-install/auto_install.py	Wed Aug 31 06:53:54 2011 -0700
+++ b/usr/src/cmd/auto-install/auto_install.py	Wed Aug 31 08:40:53 2011 -0700
@@ -124,7 +124,7 @@
         self.options, self.args = self.parse_args(args)
 
         # Initialize Install Engine
-        self.engine = InstallEngine(debug=True, stop_on_error=True)
+        self.engine = InstallEngine(stop_on_error=True)
         self.doc = self.engine.data_object_cache
 
         if self.options.zonename is not None:
@@ -858,12 +858,21 @@
             self.logger.critical("Failed Checkpoints:")
             for failed_cp in failed_cps:
                 err_data = errsvc.get_errors_by_mod_id(failed_cp)[0]
-                self.logger.critical("\t%s" % (failed_cp))
-                self.logger.exception(err_data.error_data[ES_DATA_EXCEPTION])
+                self.report_checkpoint_error(failed_cp,
+                    str(err_data.error_data[ES_DATA_EXCEPTION]))
             return False
         else:
             return True
 
+    def report_checkpoint_error(self, checkpoint_name, error_string):
+        '''Log error messages to ERROR'''
+        lines = ["", "\t%s" % checkpoint_name]
+        lines.extend(["", "Checkpoint execution error:", ""])
+        lines.extend("\t%s" % s for s in error_string.splitlines())
+        lines.append("")
+        for line in lines:
+            self.logger.error(line)
+
     def configure_checkpoints(self):
         """
         Wrapper to configure required checkpoints for performing an