]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Adding default host for VSPhere config definition
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 5 Nov 2019 15:19:44 +0000 (16:19 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 5 Nov 2019 15:19:44 +0000 (16:19 +0100)
lib/cr_tf/config.py

index e1f51c3c0be872ddbc980e66c3fab8ba689503b3..dcd9d5540daea976d309ed0868ed7ba0f948ca53 100644 (file)
@@ -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()