From 5851e094f7864d557f02611ad80982e4d2adcd1c Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 7 Sep 2015 13:30:16 +0000 Subject: Log interesting results --- firehose/plugin/firehose_plugin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/firehose/plugin/firehose_plugin.py b/firehose/plugin/firehose_plugin.py index 12272fa..270358d 100644 --- a/firehose/plugin/firehose_plugin.py +++ b/firehose/plugin/firehose_plugin.py @@ -17,6 +17,7 @@ import cliapp from contextlib import closing, contextmanager from fs.tempfs import TempFS +import logging import os import re @@ -87,6 +88,8 @@ class FirehosePlugin(cliapp.Plugin): self.update_for_conf(c) if self.updated_morphologies(): self.commit_and_push() + else: + logging.info("No new changes, no need to push.") def make_path(self, *subpath): return os.path.join(self.base_path, *subpath) @@ -204,6 +207,7 @@ class FirehosePlugin(cliapp.Plugin): def process_spec(m, kind, spec): spec['ref'] = sha spec['unpetrify-ref'] = refname + logging.info("Updated %s ref to %s and unpetrify-ref to %s", chunk, sha, refname) return True self.morphs.traverse_specs(process_spec, wanted_spec) @@ -236,7 +240,10 @@ class FirehosePlugin(cliapp.Plugin): (code, out, err) = self.app.runcmd_unchecked( ['git', 'commit', '-a', '-m', 'Firehose test commit'], cwd=self.gitpath) - if code == 0: + if code != 0: + logging.warning("Committing changes failed", extra={'error-code': code, 'stdout': out, 'stderr': err}) + else: self.app.runcmd(['git', 'push', 'origin', 'HEAD'], cwd=self.gitpath) + logging.info("Pushed changed refs") -- cgit v1.2.1