More descriptive error for a bad ref in repos.git

Fixes #771
This commit is contained in:
Evan Goode 2019-06-21 14:25:15 -04:00 committed by Brian C. Lane
parent e70aae69da
commit fef76930bc
1 changed files with 5 additions and 4 deletions

View File

@ -60,7 +60,7 @@ class GitArchiveTarball:
cmd = ["git", "clone", self._gitRepo["repo"], joinpaths(sourcesDir, "gitrepo")]
log.debug(cmd)
try:
subprocess.check_output(cmd)
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
log.error("Failed to clone %s: %s", self._gitRepo["repo"], e.output)
raise RuntimeError("Failed to clone %s" % self._gitRepo["repo"])
@ -77,10 +77,11 @@ class GitArchiveTarball:
cmd = ["git", "archive", "--prefix", self._gitRepo["rpmname"] + "/", "-o", joinpaths(sourcesDir, self.sourceName), self._gitRepo["ref"]]
log.debug(cmd)
try:
subprocess.check_output(cmd)
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
log.error("Failed to archive %s: %s", self._gitRepo["repo"], e.output)
raise RuntimeError("Failed to clone %s" % self._gitRepo["repo"])
raise RuntimeError('Failed to archive %s from ref "%s"' % (self._gitRepo["repo"],
self._gitRepo["ref"]))
finally:
# Cleanup even if there was an error
os.chdir(oldcwd)
@ -213,7 +214,7 @@ def create_gitrpm_repo(results_dir, recipe):
cmd = ["createrepo_c", gitrepo]
log.debug(cmd)
try:
subprocess.check_output(cmd)
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
log.error("Failed to create repo at %s: %s", gitrepo, e.output)
raise RuntimeError("Failed to create repo at %s" % gitrepo)