]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Changing logging output
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 15 Feb 2017 16:38:23 +0000 (17:38 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 15 Feb 2017 16:38:23 +0000 (17:38 +0100)
lib/webhooks/__init__.py
lib/webhooks/deploy.py
lib/webhooks/r10k.py

index 6b99eafa7fb6c5c8603e169acb1a912387c707e2..24b9f3e47aaf5d94cfb6bee5be20aba0f1d0652a 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/env python3
 # -*- coding: utf-8 -*-
 
-__version__ = '0.5.3'
+__version__ = '0.5.4'
 
 # vim: ts=4 et list
index 7df47492bb2ef7ed915917d21748c751986cee82..33fde3b928d4427b7b29ebbaf09e64bab869f0f2 100644 (file)
@@ -284,7 +284,7 @@ class WebhookDeployApp(BaseHookApp):
             if self.verbose > 2:
                 LOG.debug("Cmd: {}".format(pp(cmd)))
             cmd_str = ' '.join(map(lambda x: pipes.quote(x), cmd))
-            LOG.debug("Executing: {}".format(cmd_str))
+            LOG.info("Executing: {}".format(cmd_str))
 
             git = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
             (stdoutdata, stderrdata) = git.communicate()
@@ -293,7 +293,7 @@ class WebhookDeployApp(BaseHookApp):
             LOG.debug("Return value: {}".format(ret_val))
             if stdoutdata:
                 msg = "Output:\n{}".format(to_str(stdoutdata))
-                LOG.debug(msg)
+                LOG.info(msg)
                 self.print_out(msg)
             else:
                 LOG.debug("No output.")
@@ -303,7 +303,7 @@ class WebhookDeployApp(BaseHookApp):
                     LOG.warn(msg)
                     self.error_data.append(msg)
                 else:
-                    LOG.debug(msg)
+                    LOG.info(msg)
                 self.print_out(msg)
         finally:
             os.chdir(cur_dir)
index a7dea8d675751258dac8c1601e7223c77a5b45f6..d40b6f9238b3f910babde3a9a559515b071c717f 100644 (file)
@@ -186,24 +186,28 @@ class R10kHookApp(BaseHookApp):
             urllib.parse.quote(self.ref))
         url = 'https://{h}:{po}{pa}'.format(
             h=self.puppetmaster_host, po=self.puppetmaster_api_port, pa=path)
-        LOG.info("Requesting DELETE from {} ...".format(url))
+        LOG.debug("Requesting DELETE from {} ...".format(url))
 
         cmd = []
         if self.do_sudo:
             cmd = ['sudo', '-n']
 
+        cmd.append(self.curl_bin)
+        if self.verbose:
+            cmd.append('-i')
+
         cmd += [
-            self.curl_bin, '-i',
             '--cert', cert_file,
             '--key', key_file,
             '--cacert', ca_file,
+            '--silent', '--show-error',
             '-X', 'DELETE',
             url,
         ]
         cmd_str = ' '.join(map(lambda x: pipes.quote(x), cmd))
         if self.verbose > 2:
             LOG.debug("Cmd: {}".format(pp(cmd)))
-        LOG.debug("Executing: {}".format(cmd_str))
+        LOG.info("Executing: {}".format(cmd_str))
 
         if self.simulate:
             LOG.info("Simulation mode, don't executing {}.".format(self.curl_bin))
@@ -216,7 +220,7 @@ class R10kHookApp(BaseHookApp):
         LOG.debug("Return value: {}".format(ret_val))
         if stdoutdata:
             msg = "Output:\n{}".format(to_str(stdoutdata))
-            LOG.debug(msg)
+            LOG.info(msg)
             self.print_out(msg)
         else:
             LOG.debug("No output.")
@@ -226,7 +230,7 @@ class R10kHookApp(BaseHookApp):
                 LOG.warn(msg)
                 self.error_data.append(msg)
             else:
-                LOG.debug(msg)
+                LOG.info(msg)
             self.print_out(msg)
 
         return
@@ -256,7 +260,7 @@ class R10kHookApp(BaseHookApp):
         cmd_str = ' '.join(map(lambda x: pipes.quote(x), cmd))
         if self.verbose > 2:
             LOG.debug("Cmd: {}".format(pp(cmd)))
-        LOG.debug("Executing: {}".format(cmd_str))
+        LOG.info("Executing: {}".format(cmd_str))
 
         if self.simulate:
             LOG.info("Simulation mode, don't executing {!r}.".format(self.r10k_bin))
@@ -269,7 +273,7 @@ class R10kHookApp(BaseHookApp):
         LOG.debug("Return value: {}".format(ret_val))
         if stdoutdata:
             msg = "Output:\n{}".format(to_str(stdoutdata))
-            LOG.debug(msg)
+            LOG.info(msg)
             self.print_out(msg)
         else:
             LOG.debug("No output.")
@@ -280,7 +284,7 @@ class R10kHookApp(BaseHookApp):
                 self.error_data.append(msg)
                 res = False
             else:
-                LOG.debug(msg)
+                LOG.info(msg)
             self.print_out(msg)
 
         return res