@@ -49,19 +49,22 @@ def _current_platform():
49
49
return "mac" , "arm64"
50
50
if platform .system () == "Darwin" and platform .machine () == "x86_64" :
51
51
return "mac" , "amd64"
52
+
52
53
raise Exception (f"Unrecognized platform { platform .system ()} { platform .machine ()} " )
53
54
54
55
55
56
def get_url (directory : str , arch : str ) -> Tuple [Optional [str ], Optional [str ]]:
56
57
"""Searches the http directory and returns both url to installer
57
58
and version.
58
59
"""
60
+ logging .debug ('Url for installers look-up %s' , directory )
59
61
lst = requests .get (directory , allow_redirects = True )
60
62
tree = BeautifulSoup (lst .content , 'html.parser' )
61
63
links = tree .find_all ('a' )
62
64
installer , version = None , None
63
65
os_name , local_arch = _current_platform ()
64
66
for k in links :
67
+ logging .debug ('Parsing link: %s' , k .get ('href' ))
65
68
match = VERSION_RE .match (k .get ('href' ))
66
69
if match and match .group ('platform' ) == os_name :
67
70
if (local_arch == match .group ('architecture' )) \
@@ -76,7 +79,7 @@ def get_devel_url(version: str, arch: str) -> Tuple[Optional[str], Optional[str]
76
79
"""
77
80
Searches developement sources and returns url to installer
78
81
"""
79
- req = requests .get (BUILD_ROOT + version , allow_redirects = True )
82
+ req = requests .get (BUILD_ROOT + version + "/" , allow_redirects = True )
80
83
ast = BeautifulSoup (req .content , 'html.parser' )
81
84
logging .info ('Checking stage repository for installer' )
82
85
while len (ast .find_all ('p' )) != 0 and EXTRACTION_RE .match (next (ast .find_all ('p' )[0 ].children )):
@@ -90,12 +93,12 @@ def get_devel_url(version: str, arch: str) -> Tuple[Optional[str], Optional[str]
90
93
91
94
def get_prev_url (version : str , arch : str ) -> Tuple [Optional [str ], Optional [str ]]:
92
95
"""Returns installer url from dev-preview sources"""
93
- return get_url (PREVIEW_ROOT .format (arch ) + version , arch )
96
+ return get_url (PREVIEW_ROOT .format (arch ) + version + "/" , arch )
94
97
95
98
96
99
def get_prod_url (version : str , arch : str ) -> Tuple [Optional [str ], Optional [str ]]:
97
100
"""Returns installer url from production sources"""
98
- return get_url (PROD_ROOT .format (arch ) + version , arch )
101
+ return get_url (PROD_ROOT .format (arch ) + version + "/" , arch )
99
102
100
103
101
104
def _get_storage_path (version : str , install_base : str ) -> str :
@@ -147,6 +150,7 @@ def download_installer(installer_version: str,
147
150
raise Exception ("Error for source profile " + source )
148
151
149
152
url , version = downloader (installer_version , installer_arch )
153
+ logging .debug ('Installer\' s URL is %s and full version is %s' , url , version )
150
154
root = Path (dest_directory ).joinpath (version )
151
155
152
156
if root .exists () and root .joinpath ('openshift-install' ).exists ():
0 commit comments