Fix docs failures caused by latest eventlet

Closes-bug: #1674687

Change-Id: I9c44f84b1eb4f25a2c87612b444d22f12e6f22ce
This commit is contained in:
Davanum Srinivas 2017-03-21 13:23:52 -04:00
parent debc2b8fa8
commit 313b016d7c

View File

@ -22,13 +22,19 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import eventlet
import os
import subprocess
import sys
import warnings
from cinder import objects
# NOTE(dims): monkey patch subprocess to prevent failures in latest eventlet
# See https://github.com/eventlet/eventlet/issues/398
try:
eventlet.monkey_patch(subprocess=True)
except TypeError:
pass
# NOTE(geguileo): Sphinx will fail to generate the documentation if we are
# using decorators from any OVO in cinder.objects, because the OVOs are only
@ -198,6 +204,7 @@ html_static_path = ['_static']
git_cmd = ["git", "log", "--pretty=format:%ad, commit %h", "--date=local",
"-n1"]
try:
import subprocess
html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
except Exception:
warnings.warn('Cannot get last updated time from git repository. '