]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
doc/conf: find the latest stable release in releases.yml
authorKefu Chai <kchai@redhat.com>
Tue, 1 Dec 2020 06:49:56 +0000 (14:49 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 1 Dec 2020 07:41:45 +0000 (15:41 +0800)
instead of hardwiring the "|stable-release|" to "octopus" use the latest
release name found in 'doc/releases/releases.yml'

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/conf.py

index 9fb5479ba01d4729b6851a1afdbf1d9998927499..ea5c9f24735ddb17efc403f033b441b6549fc74f 100644 (file)
@@ -23,6 +23,13 @@ def parse_ceph_release():
         return version, codename, status
 
 
+def latest_stable_release():
+    with open(os.path.join(top_level, 'doc/releases/releases.yml')) as input:
+        releases = yaml.safe_load(input)['releases']
+        # get the first release
+        return next(iter(releases.keys()))
+
+
 # project information
 project = 'Ceph'
 copyright = ('2016, Ceph authors and contributors. '
@@ -114,9 +121,8 @@ if build_with_rtd:
 todo_include_todos = True
 
 # sphinx_substitution_extensions options
-# TODO: read from doc/releases/releases.yml
-rst_prolog = """
-.. |stable-release| replace:: octopus
+rst_prolog = f"""
+.. |stable-release| replace:: {latest_stable_release()}
 """
 
 # breath options