]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Detecting post install errors
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 22 Jun 2020 13:00:09 +0000 (15:00 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 22 Jun 2020 13:00:09 +0000 (15:00 +0200)
lib/cr_vmware_tpl/handler.py

index 3758f941fe0ae25a5bc41f7dd2b4708379617d46..7ac288474858fc041ba071ed704c1115a4ef167f 100644 (file)
@@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler
 
 from .xlate import XLATOR
 
-__version__ = '1.6.6'
+__version__ = '1.6.7'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -298,10 +298,10 @@ class CrTplHandler(BaseHandler):
             self.eval_tpl_ip()
             self.wait_for_finish_install()
 
-#            self.get_postinstall_error()
-#            if self.abort:
-#                LOG.warn(_("Aborting after creation of template VM."))
-#                LOG.warn(_("You are responsible yourself to cleaning up the VM!!!"))
+            self.get_postinstall_error()
+            if self.abort:
+                LOG.warn(_("Aborting after creation of template VM."))
+                LOG.warn(_("You are responsible yourself to cleaning up the VM!!!"))
 #            else:
 #                self.post_install_tasks_ssh()
 #                if self.postinstall_errors:
@@ -610,9 +610,9 @@ class CrTplHandler(BaseHandler):
             ssh.set_missing_host_key_policy(paramiko.client.AutoAddPolicy())
 
             LOG.debug(_("Connecting to {h!r}, port {p} as {u!r} per SSH ...").format(
-                h=self.config.template_vm, p=self.ssh_port, u=self.ssh_user))
+                h=self.tpl_ip, p=self.ssh_port, u=self.ssh_user))
             ssh.connect(
-                self.config.template_vm, port=self.ssh_port, timeout=self.ssh_timeout,
+                self.tpl_ip, port=self.ssh_port, timeout=self.ssh_timeout,
                 username=self.ssh_user, key_filename=self.private_ssh_key)
 
             LOG.debug(_("Trying to read {!r} ...").format('/root/postinst-error.txt'))
@@ -640,7 +640,7 @@ class CrTplHandler(BaseHandler):
                 ssh.close()
 
         if self.postinstall_errors:
-            LOG.warn(_("Template VM {!r} has to be removed.").format(self.config.template_vm))
+            LOG.warn(_("Template VM {!r} has to be removed.").format(self.tpl_ip))
 
     # -------------------------------------------------------------------------
     def post_install_tasks_ssh(self):