File tree 2 files changed +15
-7
lines changed 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1
1
PROW_VIEW_URL = "https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs"
2
2
JOB_LINK_URL = "https://prow.ci.openshift.org/"
3
- RELEASE_URL = "https://ppc64le.ocp.releases.ci.openshift.org/releasestream/4-stable-ppc64le/release/"
3
+ STABLE_RELEASE_URL = "https://ppc64le.ocp.releases.ci.openshift.org/releasestream/4-stable-ppc64le/release/"
4
+ DEV_PREVIEW_RELEASE_URL = "https://ppc64le.ocp.releases.ci.openshift.org/releasestream/4-dev-preview-ppc64le/release/"
4
5
HYPERVISOR_CONNECTION_ERROR = "failed to connect to the hypervisor"
Original file line number Diff line number Diff line change @@ -17,20 +17,27 @@ def fetch_release_date(release):
17
17
'''
18
18
Returns the created date of release
19
19
'''
20
- url = constants . RELEASE_URL + release
20
+
21
21
try :
22
+ url = constants .STABLE_RELEASE_URL + release
22
23
response = requests .get (url , verify = False , timeout = 15 )
24
+ if response .status_code == 404 :
25
+ url = constants .DEV_PREVIEW_RELEASE_URL + release
26
+ response = requests .get (url , verify = False , timeout = 15 )
27
+ if response .status_code == 404 :
28
+ print (f"Failed to get the release page. { response .text } " )
29
+ sys .exit (1 )
23
30
if response .status_code == 200 :
24
- soup = BeautifulSoup (response .text , 'html.parser' )
25
- p_elements = soup .find_all ("p" )
26
- for p in p_elements :
31
+ soup = BeautifulSoup (response .text , 'html.parser' )
32
+ p_elements = soup .find_all ("p" )
33
+ for p in p_elements :
27
34
p_ele = p .string
28
35
if p_ele :
29
36
if "Created:" in p_ele :
30
37
start_date = p_ele .split (" " )[1 ]+ " " + p_ele .split (" " )[2 ]
31
38
break
32
- return start_date
33
- else :
39
+ return start_date
40
+ else :
34
41
print (f"Failed to get the release page. { response .text } " )
35
42
sys .exit (1 )
36
43
except requests .Timeout as e :
You can’t perform that action at this time.
0 commit comments