From 902966ce25302c39fb7c6a8e2d1376f88fc6ca9d Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Sun, 6 Jul 2014 17:52:24 +0200 Subject: retry submission if it fails --- mgagnome | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mgagnome b/mgagnome index 83f5f16..d943ae8 100755 --- a/mgagnome +++ b/mgagnome @@ -979,6 +979,16 @@ class Downstream(object): cmd.append(package) return subprocess.check_call(cmd, cwd=cwd) + @classmethod + @retry(subprocess.CalledProcessError) + def ci(cls, package, changes, cwd=None): + if cwd is None: + cwd = os.path.expanduser(cls.PKGROOT) + + cmd = ['mgarepo', 'ci', '-m', changes] + return subprocess.check_call(cmd, cwd=cwd) + + def get_downstream_from_upstream(self, upstream, version): if upstream not in self.tarballs: raise ValueError("No packages for upstream name: %s" % upstream) @@ -1307,7 +1317,7 @@ def cmd_clean_spec_multi(args): # If we made it this far, checkin the changes if made_changes: if options.doit: - subprocess.check_call(['mgarepo', 'ci', '-m', s.changes], cwd=cwd) + Downstream.ci(package, s.changes, cwd=cwd) else: # show the diff and undo all changes print s.changes @@ -1376,7 +1386,7 @@ def cmd_package_new_version(options, parser): try: # If we made it this far, checkin the changes - subprocess.check_call(['mgarepo', 'ci', '-m', s.changes], cwd=cwd) + Downstream.ci(package, s.changes, cwd=cwd) # Submit is optional if options.submit: -- cgit v1.2.1