From 3c60080e93bca9d9b7f14b17295da4da8bb5c486 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 5 Nov 2019 16:19:44 +0100 Subject: [PATCH] Adding default host for VSPhere config definition --- lib/cr_tf/config.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/cr_tf/config.py b/lib/cr_tf/config.py index e1f51c3..dcd9d55 100644 --- a/lib/cr_tf/config.py +++ b/lib/cr_tf/config.py @@ -34,7 +34,7 @@ from .errors import CrTfConfigError from .xlate import XLATOR -__version__ = '1.3.4' +__version__ = '1.3.5' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -45,6 +45,7 @@ ngettext = XLATOR.ngettext class VsphereConfig(FbBaseObject): """Class for encapsulation of config data of a connection to a VSPhere center.""" + default_host = 'vcs01.ppbrln.internal' default_port = 443 default_user = 'Administrator@vsphere.local' default_dc = 'vmcc' @@ -62,7 +63,7 @@ class VsphereConfig(FbBaseObject): initialized=False): self._name = None - self._host = None + self._host = self.default_host self._port = self.default_port self._user = self.default_user self._password = None @@ -136,7 +137,7 @@ class VsphereConfig(FbBaseObject): @host.setter def host(self, value): if value is None: - self._host = None + self._host = self.default_host return val = str(value).strip().lower() if val == '': @@ -697,6 +698,10 @@ class CrTfConfiguration(BaseConfiguration): def eval_config_section(self, config, section_name): """Evaluating of all found configuration options.""" + if self.verbose > 2: + msg = _("Checking config section {!r}:").format(section_name) + LOG.debug(msg) + super(CrTfConfiguration, self).eval_config_section(config, section_name) sn = section_name.lower() -- 2.39.5