summaryrefslogtreecommitdiff
path: root/firehose
diff options
context:
space:
mode:
Diffstat (limited to 'firehose')
-rw-r--r--firehose/plugin/firehose_plugin.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/firehose/plugin/firehose_plugin.py b/firehose/plugin/firehose_plugin.py
index dbce376..ace7bdf 100644
--- a/firehose/plugin/firehose_plugin.py
+++ b/firehose/plugin/firehose_plugin.py
@@ -199,8 +199,7 @@ class FirehosePlugin(cliapp.Plugin):
self.morphs.traverse_specs(process_spec, wanted_spec)
if len(urls) != 1:
# Remove the previously recorded hash
- if self.sha_filename != "":
- os.remove(self.sha_filename)
+ os.remove(self.sha_filename)
raise cliapp.AppException(
"Woah! expected 1 chunk matching %s:%s (got %d)" % (
stratum, chunk, len(urls)))
@@ -310,5 +309,14 @@ class FirehosePlugin(cliapp.Plugin):
cwd=self.gitpath)
logging.info('commit_and_push: ' + str(code))
if code == 0:
- self.app.runcmd(['git', 'push', 'ssh://'+gerrit_username+'@'+gerrit_url+
- ':29418/baserock/baserock/definitions', branch_name], cwd=self.gitpath)
+ try:
+ # Note: cliapp needs updating such that it supports callbacks
+ self.app.runcmd(['git', 'push',
+ 'ssh://'+gerrit_username+'@'+gerrit_url+
+ ':29418/baserock/baserock/definitions',
+ branch_name], cwd=self.gitpath)
+ except cliapp.AppException:
+ # Remove the previously recorded hash
+ os.remove(self.sha_filename)
+ raise cliapp.AppException(
+ "Woah! unable to push changes to gerrit")