From f3c58c1c43bd2740c45d3dba0bda0f110ffbe6ae Mon Sep 17 00:00:00 2001 From: Timothy Chavez Date: Thu, 4 Jun 2015 18:18:51 -0500 Subject: [PATCH] Only add 'groups' file to the repo if it exists The 'groups' file gets created only if there are groups mentioned in the 'project.config' file. A 'project.config' file is not required to mention any groups, thus we should only attempt to add the 'groups' file if it exists. Change-Id: I333df5156bc27db29143ee412d86e12606faa751 --- jeepyb/cmd/manage_projects.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py index 0e73585..b248e7d 100644 --- a/jeepyb/cmd/manage_projects.py +++ b/jeepyb/cmd/manage_projects.py @@ -247,10 +247,10 @@ def create_groups_file(project, gerrit, repo_path): with open(group_file, 'w') as fp: for group, uuid in uuids.items(): fp.write("%s\t%s\n" % (uuid, group)) - status = git_command(repo_path, "add groups") - if status != 0: - log.error("Failed to add groups file for project: %s" % project) - raise CreateGroupException() + status = git_command(repo_path, "add groups") + if status != 0: + log.error("Failed to add groups file for project: %s" % project) + raise CreateGroupException() def make_ssh_wrapper(gerrit_user, gerrit_key):