Allow docs build without git

When build packages from sdist tarballs, git is not available. So
allow building the documentation without git.

Change-Id: I2e65c7eb6da2f87d97b8eae9fb7411de66416739
This commit is contained in:
Thomas Bechtold 2017-07-11 12:07:28 +02:00
parent 8fddbe2d19
commit f0f78b84c7
1 changed files with 5 additions and 1 deletions

View File

@ -106,7 +106,11 @@ version = version_info.version_string()
# These variables are passed to the logabug code via html_context.
giturl = u'https://git.openstack.org/cgit/openstack/manila/tree/doc/source'
git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '"
gitsha = os.popen(git_cmd).read().strip('\n')
try:
gitsha = os.popen(git_cmd).read().strip('\n')
except Exception:
warnings.warn('Cannot get gitsha.')
gitsha = 'unknown'
bug_tag = u'docs'
# source tree
pwd = os.getcwd()