From: Frank Brehm Date: Mon, 27 Aug 2018 14:38:12 +0000 (+0200) Subject: Bugfixing in scripts X-Git-Tag: 0.10.9^0 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=f0799200e9d3278681c2b271e376e026e3cea9a1;p=pixelpark%2Fpuppetmaster-webhooks.git Bugfixing in scripts --- diff --git a/lib/webhooks/__init__.py b/lib/webhooks/__init__.py index 246f418..380b36c 100644 --- a/lib/webhooks/__init__.py +++ b/lib/webhooks/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '0.10.8' +__version__ = '0.10.9' # vim: ts=4 et list diff --git a/lib/webhooks/show_modules.py b/lib/webhooks/show_modules.py index 874c2c3..a43fb0f 100644 --- a/lib/webhooks/show_modules.py +++ b/lib/webhooks/show_modules.py @@ -60,7 +60,7 @@ class ShowModulesApp(BaseHookApp): } # ------------------------------------------------------------------------- - def __init__(self, appname=None, verbose=0, version=__version__): + def __init__(self, output_type='json', appname=None, verbose=0, version=__version__): """Constructor.""" self.description = textwrap.dedent('''\ @@ -68,7 +68,7 @@ class ShowModulesApp(BaseHookApp): ''').strip() self.cache_file = None - self._output_type = 'json' + self._output_type = output_type self.filters = None super(ShowModulesApp, self).__init__( diff --git a/show-modules-html.py b/show-modules-html.py index 4b510ef..f46017e 100755 --- a/show-modules-html.py +++ b/show-modules-html.py @@ -17,8 +17,7 @@ from webhooks.show_modules import ShowModulesApp MY_APPNAME = os.path.basename(sys.argv[0]) LOG = logging.getLogger(MY_APPNAME) -app = ShowModulesApp(appname=MY_APPNAME) -app._output_type = 'html' +app = ShowModulesApp(output_type='html', appname=MY_APPNAME) if app.verbose > 2: LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) diff --git a/show-modules-txt.py b/show-modules-txt.py index 697930b..1f64d09 100755 --- a/show-modules-txt.py +++ b/show-modules-txt.py @@ -17,8 +17,7 @@ from webhooks.show_modules import ShowModulesApp MY_APPNAME = os.path.basename(sys.argv[0]) LOG = logging.getLogger(MY_APPNAME) -app = ShowModulesApp(appname=MY_APPNAME) -app._output_type = 'txt' +app = ShowModulesApp(output_type='txt', appname=MY_APPNAME) if app.verbose > 2: LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app))