From 0f2a2fb90cb4578359426084d98837ab5990da31 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 25 Sep 2019 15:20:32 +0200 Subject: [PATCH] Showing relative paths on not existing config files --- lib/cr_tf/__init__.py | 2 +- lib/cr_tf/app.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/cr_tf/__init__.py b/lib/cr_tf/__init__.py index 72c7bad..5906457 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.1' +__version__ = '1.3.2' 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 1aeba33..eccc00f 100644 --- a/lib/cr_tf/app.py +++ b/lib/cr_tf/app.py @@ -43,7 +43,7 @@ from .xlate import __base_dir__ as __xlate_base_dir__ from .xlate import __mo_file__ as __xlate_mo_file__ from .xlate import XLATOR, LOCALE_DIR, DOMAIN -__version__ = '1.0.5' +__version__ = '1.0.6' LOG = logging.getLogger(__name__) SIGNAL_NAMES = { @@ -217,10 +217,13 @@ class CrTfApplication(BaseApplication): if not self.cfg_file.exists(): default_conf_file = self.cfg_dir.joinpath(CFGFILE_BASENAME + '.default') + cur_dir = Path(os.getcwd()) + 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 " "fill out all necessary entries, e.g. the passwords and API keys.").format( - f=str(self.cfg_file), d=str(default_conf_file))) + f=cfg_file_rel, d=default_cfg_file_rel)) LOG.error(msg) self.exit(1) -- 2.39.5