]> Frank Brehm's Git Trees - pixelpark/puppet-tools.git/commitdiff
Fixing output of lib/dpx_puppettools/app/get_forge_module.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 15 Feb 2023 12:05:47 +0000 (13:05 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 15 Feb 2023 12:05:47 +0000 (13:05 +0100)
lib/dpx_puppettools/app/get_forge_module.py

index 7d4b97c5f3e3c7fc6c4cd5d0e8532103658d18d7..ecaabee3300279249b652c9a4e947995520dc9bb 100644 (file)
@@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
 _ = XLATOR.gettext
 ngettext = XLATOR.ngettext
 
-__version__ = '0.7.0'
+__version__ = '0.7.1'
 
 
 # =============================================================================
@@ -238,7 +238,7 @@ class GetForgeModuleApplication(BaseDPXPuppetApplication):
             return
 
         module_entry = pfile.modules[self.module_name]
-        if self.verbose > 0:
+        if self.verbose > 1:
             msg = _(
                 "Puppetfile entry of module {m!r} not found in Puppetfile of environment "
                 "{e!r}:").format(m=self.module_name, e=env)
@@ -281,9 +281,10 @@ class GetForgeModuleApplication(BaseDPXPuppetApplication):
                 if len(env) > max_len_env:
                     max_len_env = len(env)
             for env in self.mod_env_info.keys():
-                msg = ' * {env:<{width}} {info}'.format(
-                    width=(max_len_env + 1), env=(self.colored(env, 'CYAN') + ':'),
-                    info=self.mod_env_info[env])
+                diff = max_len_env - len(env)
+                gap = ' ' * diff
+                el = self.colored(env, 'CYAN') + ':' + gap
+                msg = ' * {env} {info}'.format(env=el, info=self.mod_env_info[env])
                 print(msg)
         self.empty_line()