From: Frank Brehm Date: Mon, 25 Jun 2018 14:12:27 +0000 (+0200) Subject: Substituting NTP by Chrony X-Git-Tag: 0.3.2^2~47 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=c468610e4e27aa0cacb1a7ae36f398f593786510;p=pixelpark%2Fcreate-vmware-tpl.git Substituting NTP by Chrony --- diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 315067c..c887d2f 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -36,7 +36,7 @@ from .obj import PpBaseObject from .config import CrTplConfiguration -__version__ = '0.9.2' +__version__ = '0.9.3' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -327,7 +327,23 @@ class CrTplHandler(PpBaseObject): "Strange: did not found a cluster object in data center {!r}.".format( self.config.dc)) - self.tpl_cluster = cluster_list[0] + cluster = None + + for cl in cluster_list: + if not cl.configuration.drsConfig.enabled: + LOG.warn("Cluster {!r} is not enabled.".format(cl.name)) + continue + cluster = cl + + if not cluster: + raise HandlerError( + "Strange: did not found an enabled computing cluster in data center {!r}.".format( + self.config.dc)) + + self.tpl_cluster = cluster + if self.verbose > 2: + LOG.debug("Cluster config:\n{}".format(pp(cluster.configuration))) + LOG.debug("Cluster Resource pool summary:\n{}".format(cluster.resourcePool.summary)) LOG.debug("Using cluster {!r}.".format(self.tpl_cluster.name)) # ------------------------------------------------------------------------- @@ -778,6 +794,7 @@ class CrTplHandler(PpBaseObject): ssh_available = True self.ts_finish_install = time.time() + self.ts_finish_install = time.time() duration = self.ts_finish_install - self.ts_start_install minutes = int(int(duration) / 60) seconds = duration - float(minutes * 60)