]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Ensuring existence of postfix files on the webserver.
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 19 Jun 2020 13:13:06 +0000 (15:13 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 19 Jun 2020 13:13:06 +0000 (15:13 +0200)
lib/cr_vmware_tpl/cobbler.py
lib/cr_vmware_tpl/handler.py

index 4590aec002504b46a343620f7f7151e1c79310d0..2349dcc2658ba548dab595a9aa71c6e51cb770a9 100644 (file)
@@ -40,7 +40,7 @@ from .config import CrTplConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '0.5.9'
+__version__ = '0.5.10'
 
 LOG = logging.getLogger(__name__)
 
@@ -761,8 +761,7 @@ class Cobbler(BaseHandler):
         docroot = self.config.cobbler_ws_docroot / self.config.cobbler_ws_rel_filesdir
         remote_dir = docroot / self.config.system_status / 'repos'
 
-        LOG.info(_("Ensuring currentness of snippets below {!r}.").format(
-            str(self.config.snippets_dir)))
+        LOG.info(_("Ensuring currentness of repo files below {!r}.").format(str(files_dir)))
 
         for local_repo_dir in files_dir.glob('repos-*'):
             if not local_repo_dir.is_dir():
@@ -775,7 +774,25 @@ class Cobbler(BaseHandler):
             self.ensure_remote_directory(remote_dir_os)
             for local_repo_file in local_repo_dir.glob('*.repo'):
                 remote_file = remote_dir_os / local_repo_file.name
-                self.ensure_remote_file(local_repo_file, remote_file)
+                self.ensure_remote_file(local_repo_file, remote_file, check_parent=False)
+
+        LOG.debug(_("Finished with repo files."))
+
+    # -------------------------------------------------------------------------
+    def ensure_postfix_files(self):
+
+        files_dir = self.base_dir / 'files' / 'postfix'
+        docroot = self.config.cobbler_ws_docroot / self.config.cobbler_ws_rel_filesdir
+        remote_dir = docroot / self.config.system_status / 'postfix'
+
+        LOG.info(_("Ensuring currentness of postfix files below {!r}.").format(str(files_dir)))
+
+        self.ensure_remote_directory(remote_dir)
+        for local_file in files_dir.('*'):
+            remote_file = remote_dir / local_file.name
+            self.ensure_remote_file(local_file, remote_file, check_parent=False)
+
+        LOG.debug(_("Finished with postfix files."))
 
     # -------------------------------------------------------------------------
     def get_dhcp_ip(self, mac_address):
index 38c37fee8141af5e4342f90204c5954596a4e22f..98113ac667b3adf9a0c0d1f1df60ada6b0cc4746 100644 (file)
@@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler
 
 from .xlate import XLATOR
 
-__version__ = '1.6.4'
+__version__ = '1.6.5'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -235,6 +235,7 @@ class CrTplHandler(BaseHandler):
         self.cobbler.ensure_repo_files()
         self.cobbler.ensure_bashrc()
         self.cobbler.ensure_create_motd()
+        self.cobbler.ensure_postfix_files()
 
         self.vsphere.get_about()
         self.vsphere.get_clusters()