From: Frank Brehm Date: Mon, 22 Jun 2020 14:32:46 +0000 (+0200) Subject: Ensuring existence of vimrc files X-Git-Tag: 2.1.2^2~9^2~31^2~12 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=04cb36be21d05b27e9e7231b7ee00109e9d555de;p=pixelpark%2Fcreate-vmware-tpl.git Ensuring existence of vimrc files --- diff --git a/files/bashrc-centos8 b/files/bashrc-centos8 index c232962..1915cbd 100644 --- a/files/bashrc-centos8 +++ b/files/bashrc-centos8 @@ -229,6 +229,7 @@ if [[ -z "$BASHRCSOURCED" ]]; then alias ll='ls -lA' alias md='mkdir -p' + alias vi='vim' fi diff --git a/lib/cr_vmware_tpl/cobbler.py b/lib/cr_vmware_tpl/cobbler.py index 37742d8..7634e88 100644 --- a/lib/cr_vmware_tpl/cobbler.py +++ b/lib/cr_vmware_tpl/cobbler.py @@ -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): diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 7ac2884..951a4b7 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -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()