]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
The show-modules apps are working again
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 19 Mar 2019 14:54:04 +0000 (15:54 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 19 Mar 2019 14:54:04 +0000 (15:54 +0100)
lib/webhooks/__init__.py
lib/webhooks/show_modules.py

index 1e0b2447294afc96f5915aa264a0d79a15c24abd..41193165ca8b6ff68bf6655a07c1c9d667b44ad9 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/env python3
 # -*- coding: utf-8 -*-
 
-__version__ = '1.5.3'
+__version__ = '1.5.4'
 
 # vim: ts=4 et list
index 090c17432da339e46956a52f07ad86160f61371a..ac3ee780297f03cf9eb592c5060f89cd22cf6f63 100644 (file)
@@ -229,15 +229,10 @@ class ShowModulesApp(BaseHookApp):
                     subst = forge_mod.superseded_by['slug']
                     exposed_modules[m_name].forge_superseded_by = subst
 
-        if self.verbose > 1:
+        if self.verbose > 2:
             LOG.debug(_("Modules to show:") + '\n' + pp(exposed_modules.as_list()))
 
-#        try:
-#            module_infos = self.read_cache_file()
-#        except UncriticalHookError as e:
-#            LOG.error(str(e))
-#        else:
-#            self.output_modules(module_infos)
+        self.output_modules(exposed_modules)
 
     # -------------------------------------------------------------------------
     def read_forge_cache(self):
@@ -331,6 +326,8 @@ class ShowModulesApp(BaseHookApp):
                 output_data['forge_homepage_url'] = '~'
             if not output_data['repo']:
                 output_data['repo'] = '~'
+            if not output_data['date_checked']:
+                output_data['date_checked'] = '~'
             output_data['line_class'] = line_class
             tpl = '    <tr>\n'
             tpl += '      <th class="l h confluenceTh">{name}</th>\n'
@@ -436,6 +433,10 @@ class ShowModulesApp(BaseHookApp):
                 output_data['forge_homepage_url'] = '~'
             if not output_data['repo']:
                 output_data['repo'] = '~'
+            if not output_data['date_checked']:
+                output_data['date_checked'] = '~'
+            if self.verbose > 3:
+                LOG.debug("Output data:\n" + pp(output_data))
             self.print_out(tpl.format(**output_data))
 
         self.print_out()
@@ -455,7 +456,10 @@ class ShowModulesApp(BaseHookApp):
             'full_name': module_info.full_name,
             'forge_version': module_info.forge_version,
             'forge_avail': module_info.forge_avail,
+            'forge_deprecated_at': module_info.forge_deprecated_at,
+            'forge_deprecated_for': module_info.forge_deprecated_for,
             'forge_homepage_url': module_info.forge_homepage_url,
+            'forge_superseded_by': module_info.forge_superseded_by,
             'repo': module_info.repo,
             'ts_checked': module_info.ts_checked,
             'date_checked': date_checked,