Merge "Log errors when committing and pushing acls"

This commit is contained in:
Zuul 2020-03-21 21:44:42 +00:00 committed by Gerrit Code Review
commit c7e501b57e

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): def push_acl_config(project, remote_url, repo_path, gitid, env=None):
env = env or {} env = env or {}
cmd = "commit -a -m'Update project config.' --author='%s'" % gitid 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: if status != 0:
log.error("Failed to commit config for project: %s" % project) log.error("Failed to commit config for project: %s" % project)
log.error(out)
return False return False
status, out = u.git_command_output( status, out = u.git_command_output(
repo_path, "push %s HEAD:refs/meta/config" % remote_url, env) repo_path, "push %s HEAD:refs/meta/config" % remote_url, env)
if status != 0: if status != 0:
log.error("Failed to push config for project: %s" % project) log.error("Failed to push config for project: %s" % project)
log.error(out)
return False return False
return True return True