]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Setting URL of cobbler to https
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 30 May 2024 07:38:39 +0000 (09:38 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 30 May 2024 07:38:39 +0000 (09:38 +0200)
lib/cr_vmware_tpl/cobbler/__init__.py
lib/cr_vmware_tpl/cobbler/profile.py
lib/cr_vmware_tpl/cobbler/system.py
lib/cr_vmware_tpl/config/__init__.py

index 274274b66bd81159c1546ab6947980145f30672e..64a769e3ffad1cb6ff79adb61fae60c5f1fa6930 100644 (file)
@@ -41,7 +41,7 @@ from ..errors import CobblerError, ExpectedCobblerError
 
 from ..xlate import XLATOR
 
-__version__ = '0.11.4'
+__version__ = '0.11.5'
 
 LOG = logging.getLogger(__name__)
 
@@ -98,6 +98,29 @@ class Cobbler(BaseHandler, CobblerDistro, CobblerFiles, CobblerProfile, CobblerS
         if initialized:
             self.initialized = True
 
+    # ------------------------------------------------------
+    @property
+    def url(self):
+        """The URL, which is used by new initiated VMs, to access resources on the cobbler host."""
+        return self.cfg.cobbler_ws_base_url
+
+    # -------------------------------------------------------------------------
+    def as_dict(self, short=True):
+        """
+        Transforms the elements of the object into a dict
+
+        @param short: don't include local properties in resulting dict.
+        @type short: bool
+
+        @return: structure as dict
+        @rtype:  dict
+        """
+
+        res = super(Cobbler, self).as_dict(short=short)
+        res['url'] = self.url
+
+        return res
+
     # -------------------------------------------------------------------------
     def __del__(self):
 
index d8cfb60efa46ff55392015c7b21d20bfb4acc364..492460b734a25b423a55aa20579a5063daa837bc 100644 (file)
@@ -27,7 +27,7 @@ from .. import print_section_start, print_section_end
 from ..errors import ExpectedCobblerError
 from ..xlate import XLATOR
 
-__version__ = '0.2.3'
+__version__ = '0.2.4'
 
 LOG = logging.getLogger(__name__)
 
@@ -256,7 +256,7 @@ class CobblerProfile():
             ks_meta_list.append("SWAP_SIZE_MB={}".format(self.cfg.swap_size_mb))
             ks_meta_list.append("SYSTEM_STATUS={}".format(status))
             ks_meta_list.append("WS_REL_FILESDIR={}".format(self.cfg.cobbler_ws_rel_filesdir))
-            ks_meta_list.append("COBBLER_URL=http://{}".format(self.cfg.cobbler_host))
+            ks_meta_list.append("COBBLER_URL={}".format(self.url))
             if self.cfg.current_distro.is_rhel:
                 ks_meta_list.append(
                     "RHEL9_REPOSERVER_URL={}".format(self.cfg.rhel9_repo_server_url))
@@ -301,8 +301,7 @@ class CobblerProfile():
             LOG.debug(_('Profile ks_meta {!r} is not ok.').format('WS_REL_FILESDIR'))
             ks_meta_ok = False
 
-        if 'COBBLER_URL' not in ks_meta_vars or \
-                ks_meta_vars['COBBLER_URL'] != "http://{}".format(self.cfg.cobbler_host):
+        if 'COBBLER_URL' not in ks_meta_vars or ks_meta_vars['COBBLER_URL'] != self.url:
             LOG.debug(_('Profile ks_meta {!r} is not ok.').format('COBBLER_URL'))
             ks_meta_ok = False
 
@@ -333,7 +332,7 @@ class CobblerProfile():
         ks_meta_list.append("SWAP_SIZE_MB={}".format(self.cfg.swap_size_mb))
         ks_meta_list.append("SYSTEM_STATUS={}".format(status))
         ks_meta_list.append("WS_REL_FILESDIR={}".format(self.cfg.cobbler_ws_rel_filesdir))
-        ks_meta_list.append("COBBLER_URL=http://{}".format(self.cfg.cobbler_host))
+        ks_meta_list.append("COBBLER_URL={}".format(self.url))
         if self.cfg.current_distro.is_rhel:
             ks_meta_list.append("RHEL9_REPOSERVER_URL={}".format(self.cfg.rhel9_repo_server_url))
 
index 35292a988528a1100d383d5536475ca3f49c2b00..1ca9a1a0b0cbd0b2ca6411a0938cc318f5b89373 100644 (file)
@@ -19,7 +19,7 @@ from .. import print_section_start, print_section_end
 from ..errors import ExpectedCobblerError
 from ..xlate import XLATOR
 
-__version__ = '0.2.0'
+__version__ = '0.2.1'
 
 LOG = logging.getLogger(__name__)
 
@@ -75,7 +75,7 @@ class CobblerSystem():
         ks_meta_list.append("SWAP_SIZE_MB={}".format(self.cfg.swap_size_mb))
         ks_meta_list.append("SYSTEM_STATUS={}".format(status))
         ks_meta_list.append("WS_REL_FILESDIR={}".format(self.cfg.cobbler_ws_rel_filesdir))
-        ks_meta_list.append("COBBLER_URL=http://{}".format(self.cfg.cobbler_host))
+        ks_meta_list.append("COBBLER_URL={}".format(self.url))
         if self.cfg.rhsm_user:
             ks_meta_list.append("RHSM_USER={}".format(self.cfg.rhsm_user))
         if self.cfg.rhsm_pwd:
index cd79f3e2e6cd191218bf4794ef7a6fbaa0ae5b9f..87fb9681d3ea378142304ece025d61f321c0b363 100644 (file)
@@ -38,7 +38,7 @@ from .eval import ConfigEval
 from .ldap import LdapConnectionInfo, LdapConnectionDict
 from .timeouts import ConfigTimeouts
 
-__version__ = '3.3.1'
+__version__ = '3.3.2'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -102,7 +102,7 @@ class CrTplConfiguration(BaseMultiConfig, ConfigCobbler, ConfigTimeouts, ConfigE
     resolv_conf = Path('/etc/resolv.conf')
     evaluated_resolv_conf = False
 
-    default_cobbler_ws_base_url = 'http://cobbler.pixelpark.com'
+    default_cobbler_ws_base_url = 'https://cobbler.pixelpark.com'
     default_cobbler_ws_docroot = Path('/var/www/html')
     default_cobbler_ws_rel_filesdir = Path('custom/vmware-template-files')