#!/bin/env python3
# -*- coding: utf-8 -*-
-__version__ = '0.8.1'
+__version__ = '0.8.2'
# vim: ts=4 et list
self.cmdline_args = None
+ self.puppet_bin = None
self.curl_bin = None
self.error_data = []
else:
LOG.debug("We are NOT in CGI.")
+ self.search_puppet_bin()
self.search_curl_bin()
return
sys.stderr.write("\nSimulation mode - nothing is really done.\n\n")
self.simulate = True
+ # -------------------------------------------------------------------------
+ def search_puppet_bin(self):
+
+ searcher = BaseHandler(
+ appname=self.appname, verbose=self.verbose, base_dir=self.base_dir)
+
+ cmd = searcher.get_cmd('puppet')
+ del searcher
+ if not cmd:
+ sys.exit(9)
+ self.puppet_bin = cmd
+ return
+
# -------------------------------------------------------------------------
def search_curl_bin(self):
super(WebhookDeployApp, self).__init__(
appname=appname, verbose=verbose, version=version)
- # -------------------------------------------------------------------------
- def as_dict(self):
- """
- Transforms the elements of the object into a dict
-
- @return: structure as dict
- @rtype: dict
- """
-
- res = super(WebhookDeployApp, self).as_dict()
-
- return res
+# # -------------------------------------------------------------------------
+# def as_dict(self, short=True):
+# """
+# Transforms the elements of the object into a dict
+#
+# @return: structure as dict
+# @rtype: dict
+# """
+#
+# res = super(WebhookDeployApp, self).as_dict()
+#
+# return res
# -------------------------------------------------------------------------
def evaluate_config(self, config, yaml_file):
out += ", ".join(fields) + ")>"
return out
+ # -------------------------------------------------------------------------
+ def get_cmd(self, cmd):
+
+ return self.get_command(cmd)
+
# -------------------------------------------------------------------------
def get_command(self, cmd, quiet=False):
"""
@copyright: © 2017 by Frank Brehm, Berlin
@summary: The module for the r10k_hook application object.
"""
+from __future__ import absolute_import
# Standard modules
import sys
# Own modules
import webhooks
-from webhooks.common import pp, to_str, to_bool
+from .common import pp, to_str, to_bool
-from webhooks.base_app import BaseHookApp
+from .base_app import BaseHookApp
+
+from .handler import BaseHandler
__version__ = webhooks.__version__
LOG = logging.getLogger(__name__)
self.check_cert_files()
# -------------------------------------------------------------------------
- def as_dict(self):
+ def as_dict(self, short=True):
"""
Transforms the elements of the object into a dict
# -------------------------------------------------------------------------
def search_r10k_bin(self):
- cmd = self.get_cmd('r10k')
+ searcher = BaseHandler(
+ appname=self.appname, verbose=self.verbose, base_dir=self.base_dir)
+
+ cmd = searcher.get_cmd('r10k')
+ del searcher
if not cmd:
sys.exit(9)
self.r10k_bin = cmd