summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-09-07 13:30:16 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-09-07 13:30:16 +0000
commit5851e094f7864d557f02611ad80982e4d2adcd1c (patch)
tree7b0dacbf5521e72e01bce75abc91b69f96a5abb0
parent45407215f72e8fcde72a793fcc9083483c1136da (diff)
downloadfirehose-5851e094f7864d557f02611ad80982e4d2adcd1c.tar.gz
Log interesting results
-rw-r--r--firehose/plugin/firehose_plugin.py9
1 files changed, 8 insertions, 1 deletions
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")