]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Ensuring bashrc files on Cobbler Webserver
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 17 Jun 2020 11:42:20 +0000 (13:42 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 17 Jun 2020 11:42:20 +0000 (13:42 +0200)
lib/cr_vmware_tpl/cobbler.py
lib/cr_vmware_tpl/handler.py

index 102b173350cebb8d6a2aa8d1733fa9193dc47eba..f91294f218dcfffed2659b8a25f7285751a2969f 100644 (file)
@@ -40,7 +40,7 @@ from .config import CrTplConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '0.5.7'
+__version__ = '0.5.8'
 
 LOG = logging.getLogger(__name__)
 
@@ -626,6 +626,21 @@ class Cobbler(BaseHandler):
                 loc=str(local_snippet), rem=str(remote_snippet)))
             self.ensure_remote_file(local_snippet, remote_snippet, check_parent=False)
 
+    # -------------------------------------------------------------------------
+    def ensure_bashrc(self):
+
+        files_dir = self.base_dir / 'files'
+        docroot = self.config.cobbler_ws_docroot / self.config.cobbler_ws_rel_filesdir
+        remote_dir = docroot / self.config.system_status
+
+        LOG.info(_("Ensuring currentness of bashrc files."))
+
+        for local_rc_file in files_dir.glob('bashrc*'):
+            remote_rc_file = remote_dir / local_rc_file.name
+            LOG.debug(_("Ensuring {loc!r} => {rem!r}.").format(
+                loc=str(local_rc_file), rem=str(remote_rc_file)))
+            self.ensure_remote_file(local_rc_file, remote_rc_file, check_parent=False)
+
     # -------------------------------------------------------------------------
     def add_system(self, name, fqdn, mac_address, comment=None):
         """Creating a new system."""
index cfa96f1dad2010a8da5b4927366a0c98752a74be..275c578a7e891ccf1963f8afe13a83f72bc32cb8 100644 (file)
@@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler
 
 from .xlate import XLATOR
 
-__version__ = '1.6.2'
+__version__ = '1.6.3'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -233,6 +233,7 @@ class CrTplHandler(BaseHandler):
         self.cobbler.ensure_snippets()
         self.cobbler.ensure_keys()
         self.cobbler.ensure_repo_files()
+        self.cobbler.ensure_bashrc()
 
         self.vsphere.get_about()
         self.vsphere.get_clusters()