@@ -7,7 +7,7 @@ def if_version_supported(version):
7
7
return tuple (map (int , version .split ('.' ))) > tuple (map (int , LATEST_VERSION_SUPPORTED .split ('.' )))
8
8
9
9
def update_nginx_version (source_file , destination_file , new_version ):
10
- with open (source_file , 'r' ) as file :
10
+ with open (source_file ) as file :
11
11
file_content = file .read ()
12
12
13
13
updated_content = file_content .replace ("{NGINX_VERSION}" , new_version )
@@ -25,14 +25,12 @@ def update_nginx_version(source_file, destination_file, new_version):
25
25
26
26
if get_nginx_release_versions .returncode != 0 :
27
27
print ("Could not get nginx versions:" , stderr .decode ())
28
- exit ()
29
-
30
-
31
- for line in stdout .decode ().splitlines ():
32
- version , link = line .split (' ' , 1 )
33
-
34
- if if_version_supported (version ):
35
- print ("export NGINX_VERSION_TO_TEST=" + version )
36
- update_nginx_version ("base_config.yml" , "config.yml" , version )
37
- subprocess .run (["mv config.yml ../.circleci/config.yml" ], shell = True , check = True )
38
- break
28
+ else :
29
+ for line in stdout .decode ().splitlines ():
30
+ version , link = line .split (' ' , 1 )
31
+
32
+ if if_version_supported (version ):
33
+ print ("export NGINX_VERSION_TO_TEST=" + version )
34
+ update_nginx_version ("base_config.yml" , "config.yml" , version )
35
+ subprocess .run (["mv config.yml ../.circleci/config.yml" ], shell = True , check = True )
36
+ break
0 commit comments