From efd06340c867f6fa2762805a60b140e2b1f3ec86 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 7 Feb 2019 10:42:27 +0100 Subject: [PATCH] Catching VSphereExpectedError in lib/cr_vmware_tpl/handler.py --- lib/cr_vmware_tpl/handler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 9a21924..b9d67c6 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -30,12 +30,13 @@ from fb_tools.errors import HandlerError, ExpectedHandlerError from fb_tools.handler import BaseHandler +from fb_tools.vsphere.errors import VSphereExpectedError from fb_tools.vsphere.server import VsphereServer from fb_tools.vsphere.iface import VsphereVmInterface from .config import CrTplConfiguration -__version__ = '1.0.1' +__version__ = '1.1.0' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -135,6 +136,11 @@ class CrTplHandler(BaseHandler): retval = self.run() + except VSphereExpectedError as e: + msg = "Got a {n}: {e}".format(n=e.__class__.__name__, e=e) + LOG.error(msg) + retval = 9 + finally: # Aufräumen ... self.cluster = None -- 2.39.5