From: Frank Brehm Date: Wed, 25 Sep 2019 14:02:44 +0000 (+0200) Subject: Checking for existence of directory of postinstall scripts. X-Git-Tag: 1.3.3^0 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=8f3170f00bdd85698cd41baef6a7a521f809fad2;p=pixelpark%2Fcreate-terraform.git Checking for existence of directory of postinstall scripts. --- diff --git a/etc/create-terraform.ini.default b/etc/create-terraform.ini.default index 6bf4f38..755c7e9 100644 --- a/etc/create-terraform.ini.default +++ b/etc/create-terraform.ini.default @@ -12,7 +12,7 @@ ;time_zone = Europe/Berlin ; Puppetmaster - wird bei 'terraform destroy' verwendet -;puppet_master = puppetmaster01.pixelpark.com +;puppet_master = puppetmaster04.pixelpark.com ; Puppetca-Host wird für die Registrierung neu installierter Maschinen bei Puppet ; während 'terraform apply' verwendet diff --git a/lib/cr_tf/__init__.py b/lib/cr_tf/__init__.py index 5906457..3c038de 100644 --- a/lib/cr_tf/__init__.py +++ b/lib/cr_tf/__init__.py @@ -1,7 +1,7 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '1.3.2' +__version__ = '1.3.3' MIN_VERSION_TERRAFORM = '0.12.0' MAX_VERSION_TERRAFORM = '0.12.99' diff --git a/lib/cr_tf/app.py b/lib/cr_tf/app.py index eccc00f..2425e17 100644 --- a/lib/cr_tf/app.py +++ b/lib/cr_tf/app.py @@ -221,7 +221,7 @@ class CrTfApplication(BaseApplication): cfg_file_rel = os.path.relpath(str(self.cfg_file), str(cur_dir)) default_cfg_file_rel = os.path.relpath(str(default_conf_file), str(cur_dir)) msg = (_( - "Configuration file {f!r} does not exists. Please copy {d!r} to {f!r} and " + "Configuration file {f!r} does not exists.\nPlease copy {d!r} to {f!r} and " "fill out all necessary entries, e.g. the passwords and API keys.").format( f=cfg_file_rel, d=default_cfg_file_rel)) LOG.error(msg) diff --git a/lib/cr_tf/handler.py b/lib/cr_tf/handler.py index 11bdd3f..e378993 100644 --- a/lib/cr_tf/handler.py +++ b/lib/cr_tf/handler.py @@ -59,7 +59,7 @@ from .terraform.disk import TerraformDisk from .xlate import XLATOR -__version__ = '2.8.8' +__version__ = '2.8.9' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -216,6 +216,15 @@ class CreateTerraformHandler(BaseHandler): self.config = config self.script_dir = self.base_dir.joinpath('postinstall-scripts') + LOG.debug(_("Directory for postinstall scripts: {!r}").format(str(self.script_dir))) + if not self.script_dir.exists(): + msg = _("Directory for postinstall scripts {!r} does not exists.").format( + str(self.script_dir)) + raise ExpectedHandlerError(msg) + if not self.script_dir.is_dir(): + msg = _("Path {!r} for postinstall scripts exists, but is not a directory.").format( + str(self.script_dir)) + raise ExpectedHandlerError(msg) if initialized: self.initialized = True