summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bechtold <tbechtold@suse.com>2016-04-13 09:50:46 +0200
committerThomas Bechtold <tbechtold@suse.com>2016-04-13 09:51:11 +0200
commit5024a8cb784e26a7124d0cceba1a41439ffacccf (patch)
treee49f51b910b0282b81968f700e347482a7672a4d
parent391640b20380625e762cf89602525b31f51d246d (diff)
Fix doc build if git is absent
When building packages if git is absent, then we should not set html_last_updated_fmt. It can still be set via the -D switch when building with sphinx-build. Change-Id: I2c219d64e33ab8af7e883e6153855d040d8f8f38 Closes-Bug: #1552251
Notes
Notes (review): Code-Review+1: Thomas Goirand <thomas@goirand.fr> Code-Review+2: Andrey Pavlov <andrey.mp@gmail.com> Workflow+1: Andrey Pavlov <andrey.mp@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 13 Apr 2016 11:43:46 +0000 Reviewed-on: https://review.openstack.org/305024 Project: openstack/ec2-api Branch: refs/heads/master
-rw-r--r--doc/source/conf.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 4d643a3..d670c64 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -6,6 +6,7 @@ import sys
6import os 6import os
7import fileinput 7import fileinput
8import fnmatch 8import fnmatch
9import warnings
9 10
10BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 11BASE_DIR = os.path.dirname(os.path.abspath(__file__))
11ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) 12ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
@@ -63,8 +64,12 @@ htmlhelp_basename = '%sdoc' % project
63 64
64git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", 65git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
65 "-n1"] 66 "-n1"]
66html_last_updated_fmt = subprocess.Popen( 67try:
67 git_cmd, stdout=subprocess.PIPE).communicate()[0] 68 html_last_updated_fmt = subprocess.Popen(
69 git_cmd, stdout=subprocess.PIPE).communicate()[0]
70except Exception:
71 warnings.warn('Cannot get last updated time from git repository. '
72 'Not setting "html_last_updated_fmt".')
68 73
69# Grouping the document tree into LaTeX files. List of tuples 74# Grouping the document tree into LaTeX files. List of tuples
70# (source start file, target name, title, author, documentclass 75# (source start file, target name, title, author, documentclass