From 8ce59472653439d646309395bf195ec6163ff29a Mon Sep 17 00:00:00 2001 From: Robert Myers Date: Fri, 15 Feb 2013 14:32:07 -0600 Subject: Change the check for the existence of .git directory. In common setup the check for the .git directory is too restrictive. Instead of checking that it is a directory just check to see if it exists. That way if the project is part of a submodule it will continue to work correctly. Change-Id: If6b6531ab5778ac17537e3f18bde1844620c8316 Fixes: bug 1126416 --- openstack/common/setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openstack/common/setup.py') diff --git a/openstack/common/setup.py b/openstack/common/setup.py index 2a971e7..22f864d 100644 --- a/openstack/common/setup.py +++ b/openstack/common/setup.py @@ -131,7 +131,7 @@ def write_git_changelog(): """Write a changelog based on the git changelog.""" new_changelog = 'ChangeLog' if not os.getenv('SKIP_WRITE_GIT_CHANGELOG'): - if os.path.isdir('.git'): + if os.path.exists('.git'): git_log_cmd = 'git log --stat' changelog = _run_shell_command(git_log_cmd) mailmap = parse_mailmap() @@ -147,7 +147,7 @@ def generate_authors(): old_authors = 'AUTHORS.in' new_authors = 'AUTHORS' if not os.getenv('SKIP_GENERATE_AUTHORS'): - if os.path.isdir('.git'): + if os.path.exists('.git'): # don't include jenkins email address in AUTHORS file git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | " "egrep -v '" + jenkins_email + "'") @@ -279,7 +279,7 @@ def _get_version_from_git(pre_version): revision if there is one, or tag plus number of additional revisions if the current revision has no tag.""" - if os.path.isdir('.git'): + if os.path.exists('.git'): if pre_version: try: return _run_shell_command( -- cgit