@@ -90,8 +90,8 @@ def load_platform_configs(path: Path) -> Set[PlatformInfo]:
9090 platform_name = distro ["opennebula_image_name" ],
9191 version = distro ["distr_version" ],
9292 arch = arch ,
93- flavor_name = distro .get ("test_flavor_name" ),
94- flavor_version = distro .get ("test_flavor_version" )
93+ flavor_name = distro .get ("test_flavor_name" , "base_image" ),
94+ flavor_version = distro .get ("test_flavor_version" , None )
9595 )
9696 data_entries .add (platform_info )
9797 return data_entries
@@ -187,7 +187,7 @@ def run_terraform_plan(workdir: Path) -> Optional[str]:
187187 )
188188 if code != 0 :
189189 logger .error (f"Terraform plan failed: { stderr } " )
190- return None
190+ raise RuntimeError ( "Terraform plan failed." )
191191 return extract_template_names (stdout )
192192
193193
@@ -215,7 +215,7 @@ def check_template_for_platform(
215215 all_architectures = '|' .join (SUPPORTED_ARCHITECTURES )
216216 all_test_flavor_names = '|' .join (set (pl .flavor_name for pl in platforms if pl .flavor_name ))
217217 all_test_flavor_names += '|base_image'
218- optional_test_flavor_version = r'(\d+(?:\.\d+)?)?'
218+ optional_test_flavor_version = '|' . join ( set ( pl . flavor_version for pl in platforms if pl . flavor_version ))
219219
220220 for channel in CONFIG .allowed_channel_names :
221221 renderer .render_tf_main_file (
@@ -227,7 +227,7 @@ def check_template_for_platform(
227227 vm_name = 'vm' ,
228228 package_channel = channel ,
229229 test_flavor_name = f'({ all_test_flavor_names } )' ,
230- test_flavor_version = f'({ optional_test_flavor_version } )' ,
230+ test_flavor_version = f'({ optional_test_flavor_version } )? ' ,
231231 )
232232 templates = run_terraform_plan (workdir )
233233 if templates :
@@ -246,12 +246,13 @@ def get_found_platforms(found_templates: List[str]) -> Set[PlatformInfo]:
246246 Set[PlatformInfo]
247247 """
248248 pattern = re .compile (
249- r'^' # Anchor to start
249+ r'^'
250250 r'(?P<platform_name>\w+(?:-\w+)?)'
251251 r'-(?P<version>\d+(?:\.\d+)?)'
252- r'-(?P<arch>\w+)'
253- r'\.(?P<flavor_name>\w+(?:-\w+)?)'
254- r'-?(?P<flavor_version>\d+(?:\.\d+)?)?'
252+ r'-(?P<arch>[\w]+)'
253+ r'\.(?P<flavor_name>\w+)'
254+ r'(?:-(?P<flavor_version>.+))?'
255+ r'\.test_system\b'
255256 )
256257
257258 result = set ()
0 commit comments