From f0f78b84c71b322d4c55c31511a62b97a0755e6e Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Tue, 11 Jul 2017 12:07:28 +0200 Subject: [PATCH] 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 --- doc/source/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index f48169fb26..e975ee8f10 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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()