mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
doc: fetch releases from main branch
So we do not need to backport actual EOL dates.
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
(cherry picked from commit 4e57701c59)
This commit is contained in:
parent
e911bdebe5
commit
ed6bbc6454
18
doc/conf.py
18
doc/conf.py
@ -6,7 +6,9 @@ import shutil
|
||||
import sys
|
||||
import yaml
|
||||
import sphinx.util
|
||||
import urllib.request
|
||||
|
||||
logger = sphinx.util.logging.getLogger(__name__)
|
||||
|
||||
top_level = \
|
||||
os.path.dirname(
|
||||
@ -38,10 +40,18 @@ def latest_stable_release():
|
||||
|
||||
|
||||
def is_release_eol(codename):
|
||||
with open(os.path.join(top_level, 'doc/releases/releases.yml')) as input:
|
||||
releases = yaml.safe_load(input)['releases']
|
||||
return 'actual_eol' in releases.get(codename, {})
|
||||
|
||||
# Try fetching the latest status from the main branch first
|
||||
try:
|
||||
url = "https://raw.githubusercontent.com/ceph/ceph/main/doc/releases/releases.yml"
|
||||
with urllib.request.urlopen(url, timeout=5) as response:
|
||||
releases = yaml.safe_load(response)['releases']
|
||||
return 'actual_eol' in releases.get(codename, {})
|
||||
except Exception as e:
|
||||
logger.warn(f"Failed to fetch releases.yml from main, falling back to local: {e}")
|
||||
# Fallback to the local file if the network request fails
|
||||
with open(os.path.join(top_level, 'doc/releases/releases.yml')) as input:
|
||||
releases = yaml.safe_load(input)['releases']
|
||||
return 'actual_eol' in releases.get(codename, {})
|
||||
|
||||
# project information
|
||||
project = 'Ceph'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user