summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVu Cong Tuan <tuanvc@vn.fujitsu.com>2017-06-04 12:26:44 +0700
committerVu Cong Tuan <tuanvc@vn.fujitsu.com>2017-06-04 12:27:00 +0700
commit5f1377bb940b2af4a2ef3a71e711ed8edd5fd1e1 (patch)
treed7e1325c6999cf8bc3aeb28f751ee6f39df16255
parent1755447b73c7886a6c09b86289ea6b121aaddc86 (diff)
Fix html_last_updated_fmt for Python3
html_last_updated_fmt option is interpreted as a byte string in python3, causing Sphinx build to break. This patch makes it utf-8 string. Change-Id: I39e3cc70f51f9ebb2973ea5a7e6cb12d3b19d6cb Closes-Bug:#1693670
Notes
Notes (review): 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: Sun, 04 Jun 2017 07:16:05 +0000 Reviewed-on: https://review.openstack.org/470672 Project: openstack/ec2-api Branch: refs/heads/master
-rw-r--r--api-ref/source/conf.py3
-rw-r--r--doc/source/conf.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py
index 5d50ae1..777355f 100644
--- a/api-ref/source/conf.py
+++ b/api-ref/source/conf.py
@@ -157,8 +157,7 @@ pygments_style = 'sphinx'
157git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", 157git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
158 "-n1"] 158 "-n1"]
159try: 159try:
160 html_last_updated_fmt = subprocess.Popen( 160 html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
161 git_cmd, stdout=subprocess.PIPE).communicate()[0].decode()
162except Exception: 161except Exception:
163 warnings.warn('Cannot get last updated time from git repository. ' 162 warnings.warn('Cannot get last updated time from git repository. '
164 'Not setting "html_last_updated_fmt".') 163 'Not setting "html_last_updated_fmt".')
diff --git a/doc/source/conf.py b/doc/source/conf.py
index d670c64..8a4c8fb 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -65,8 +65,7 @@ htmlhelp_basename = '%sdoc' % project
65git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", 65git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
66 "-n1"] 66 "-n1"]
67try: 67try:
68 html_last_updated_fmt = subprocess.Popen( 68 html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
69 git_cmd, stdout=subprocess.PIPE).communicate()[0]
70except Exception: 69except Exception:
71 warnings.warn('Cannot get last updated time from git repository. ' 70 warnings.warn('Cannot get last updated time from git repository. '
72 'Not setting "html_last_updated_fmt".') 71 'Not setting "html_last_updated_fmt".')