Log errors when committing and pushing acls

For some reason we don't log the git output so failures are opaque to
us. Fix that by adding additonal logging.

Change-Id: If212ae6115c8266e1352431588c04547c897e982
This commit is contained in:
Clark Boylan 2020-01-28 10:46:45 -08:00
parent cef1dde44f
commit 369d025428
1 changed files with 3 additions and 1 deletions

View File

@ -172,14 +172,16 @@ def copy_acl_config(project, repo_path, acl_config):
def push_acl_config(project, remote_url, repo_path, gitid, env=None):
env = env or {}
cmd = "commit -a -m'Update project config.' --author='%s'" % gitid
status = u.git_command(repo_path, cmd)
status, out = u.git_command_output(repo_path, cmd)
if status != 0:
log.error("Failed to commit config for project: %s" % project)
log.error(out)
return False
status, out = u.git_command_output(
repo_path, "push %s HEAD:refs/meta/config" % remote_url, env)
if status != 0:
log.error("Failed to push config for project: %s" % project)
log.error(out)
return False
return True