File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 33STABLE_RELEASE_URL = "https://ppc64le.ocp.releases.ci.openshift.org/releasestream/4-stable-ppc64le/release/"
44DEV_PREVIEW_RELEASE_URL = "https://ppc64le.ocp.releases.ci.openshift.org/releasestream/4-dev-preview-ppc64le/release/"
55HYPERVISOR_CONNECTION_ERROR = "failed to connect to the hypervisor"
6+ RELEASE_BASE_URL = "https://ppc64le.ocp.releases.ci.openshift.org"
Original file line number Diff line number Diff line change @@ -30,14 +30,28 @@ def fetch_release_date(release):
3030 sys .exit (1 )
3131 if response .status_code == 200 :
3232 soup = BeautifulSoup (response .text , 'html.parser' )
33+ forms = soup .find_all ("form" , {"method" : "GET" })
3334 p_elements = soup .find_all ("p" )
3435 for p in p_elements :
3536 p_ele = p .string
3637 if p_ele :
3738 if "Created:" in p_ele :
3839 start_date = p_ele .split (" " )[1 ]+ " " + p_ele .split (" " )[2 ]
39- break
40- return start_date
40+ return start_date
41+ for form in forms :
42+ a_tag = form .find ("a" , href = True )
43+ if a_tag and "changelog" in a_tag ["href" ]:
44+ changelog_url = constants .RELEASE_BASE_URL + a_tag ["href" ]
45+ changelog_resp = requests .get (changelog_url , verify = False , timeout = 15 )
46+ if changelog_resp .status_code == 200 :
47+ lines = changelog_resp .text .splitlines ()
48+ for line in lines :
49+ if "Created:" in line :
50+ start_date = line .split (" " )[1 ]+ " " + line .split (" " )[2 ]
51+ return start_date
52+ else :
53+ print (f"Failed to get the changelog page." )
54+ sys .exit (1 )
4155 else :
4256 print (f"Failed to get the release page. { response .text } " )
4357 sys .exit (1 )
You can’t perform that action at this time.
0 commit comments