Browse Source

Merge "Fix doc build if git is absent"

tags/2.6.0^0
Jenkins 3 years ago
parent
commit
d5020aed64
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      doc/source/conf.py

+ 7
- 2
doc/source/conf.py View File

@@ -17,6 +17,7 @@ from __future__ import unicode_literals
17 17
 import os
18 18
 import subprocess
19 19
 import sys
20
+import warnings
20 21
 
21 22
 import pbr.version
22 23
 
@@ -150,8 +151,12 @@ modindex_common_prefix = ['keystoneauth1.']
150 151
 # using the given strftime format.
151 152
 git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
152 153
            "-n1"]
153
-html_last_updated_fmt = subprocess.Popen(
154
-    git_cmd, stdout=subprocess.PIPE).communicate()[0]
154
+try:
155
+    html_last_updated_fmt = subprocess.Popen(
156
+        git_cmd, stdout=subprocess.PIPE).communicate()[0]
157
+except:
158
+    warnings.warn('Cannot get last updated time from git repository. '
159
+                  'Not setting "html_last_updated_fmt".')
155 160
 
156 161
 # If true, SmartyPants will be used to convert quotes and dashes to
157 162
 # typographically correct entities.

Loading…
Cancel
Save