]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Ensuring existence of vimrc files
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 22 Jun 2020 14:32:46 +0000 (16:32 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 22 Jun 2020 14:32:46 +0000 (16:32 +0200)
files/bashrc-centos8
lib/cr_vmware_tpl/cobbler.py
lib/cr_vmware_tpl/handler.py

index c232962dadb83bf9e73c795873f519c824271be4..1915cbd1a13ae88e7ac1ee8cc9017304f2e8fd0f 100644 (file)
@@ -229,6 +229,7 @@ if [[ -z "$BASHRCSOURCED" ]]; then
         alias ll='ls -lA'
         alias md='mkdir -p'
 
+        alias vi='vim'
 
     fi
 
index 37742d85eb39ac546b2f65ead37dbcc41b627283..7634e8880bff9952942b92e426a8fc0a61cabae9 100644 (file)
@@ -40,7 +40,7 @@ from .config import CrTplConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '0.5.11'
+__version__ = '0.5.12'
 
 LOG = logging.getLogger(__name__)
 
@@ -641,6 +641,21 @@ class Cobbler(BaseHandler):
                 loc=str(local_rc_file), rem=str(remote_rc_file)))
             self.ensure_remote_file(local_rc_file, remote_rc_file, check_parent=False)
 
+    # -------------------------------------------------------------------------
+    def ensure_vimrc(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 vimrc files."))
+
+        for local_rc_file in files_dir.glob('vimrc*'):
+            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 ensure_logrotate_files(self):
 
index 7ac288474858fc041ba071ed704c1115a4ef167f..951a4b7b38c8f04d512269f6a8d96325583ec2a1 100644 (file)
@@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler
 
 from .xlate import XLATOR
 
-__version__ = '1.6.7'
+__version__ = '1.6.8'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -234,6 +234,7 @@ class CrTplHandler(BaseHandler):
         self.cobbler.ensure_keys()
         self.cobbler.ensure_repo_files()
         self.cobbler.ensure_bashrc()
+        self.cobbler.ensure_vimrc()
         self.cobbler.ensure_create_motd()
         self.cobbler.ensure_postfix_files()
         self.cobbler.ensure_logrotate_files()