1818import yaml
1919import urllib .request
2020
21+ from ..logger import LoggerSetup
22+
23+ LOGGER = LoggerSetup .get_logger ("gardenlinux.github" )
2124
2225GARDENLINUX_GITHUB_RELEASE_BUCKET_NAME = "gardenlinux-github-releases"
2326
2427
25- cloud_fullname_dict = {
28+ CLOUD_FULLNAME_DICT = {
2629 'ali' : 'Alibaba Cloud' ,
2730 'aws' : 'Amazon Web Services' ,
2831 'gcp' : 'Google Cloud Platform' ,
@@ -118,7 +121,7 @@ def get_platform_display_name(platform):
118121 """
119122 match platform :
120123 case 'ali' | 'openstackbaremetal' | 'openstack' | 'azure' | 'gcp' | 'aws' :
121- return cloud_fullname_dict [platform ]
124+ return CLOUD_FULLNAME_DICT [platform ]
122125 case _:
123126 return platform .upper ()
124127
@@ -414,7 +417,7 @@ def generate_detailed_format(grouped_data):
414417 output += f"### Variant - { VARIANT_NAMES [variant ]} \n \n "
415418
416419 for platform in sorted (grouped_data [variant ].keys ()):
417- platform_long_name = cloud_fullname_dict .get (platform , platform )
420+ platform_long_name = CLOUD_FULLNAME_DICT .get (platform , platform )
418421 output += f"<details>\n <summary>{ platform .upper ()} - { platform_long_name } </summary>\n \n "
419422 output += f"#### { platform .upper ()} - { platform_long_name } \n \n "
420423
@@ -484,15 +487,15 @@ def download_metadata_file(s3_artifacts, cname, version, commitish_short, artifa
484487 """
485488 Download metadata file (s3_metadata.yaml)
486489 """
487- print (f'YTDBG // { s3_artifacts = } | { cname = } | { version = } | { commitish_short = } | { artifacts_dir = } ' )
490+ LOGGER . debug (f'{ s3_artifacts = } | { cname = } | { version = } | { commitish_short = } | { artifacts_dir = } ' )
488491 _release_objects = s3_artifacts ._bucket .objects .filter (Prefix = f"meta/singles/{ cname } -{ version } -{ commitish_short } " )
489492 for o in _release_objects :
490- print (f'YTDBG // { o .bucket_name = } | { o .key = } ' )
493+ LOGGER . debug (f'{ o .bucket_name = } | { o .key = } ' )
491494 release_object = list (
492495 s3_artifacts ._bucket .objects .filter (Prefix = f"meta/singles/{ cname } -{ version } -{ commitish_short } " )
493496 )[0 ]
494497 print (f'YTBDG // { release_object .bucket_name = } | { release_object .key = } ' )
495- print (f'YTDBG // { release_object = } ' )
498+ LOGGER . debug (f'{ release_object = } ' )
496499 s3_artifacts ._bucket .download_file (
497500 release_object .key , artifacts_dir .joinpath (f"{ cname } .s3_metadata.yaml" )
498501 )
@@ -515,7 +518,7 @@ def download_all_metadata_files(version, commitish):
515518
516519 for flavor in flavors :
517520 cname = CName (flavor [1 ], flavor [0 ], "{0}-{1}" .format (version , commitish_short ))
518- print (f'YTDBG // { flavor = } { version = } { commitish = } ' )
521+ LOGGER . debug (f'{ flavor = } { version = } { commitish = } ' )
519522 # Filter by image variants - only download if the flavor matches one of the variants
520523 flavor_matches_variant = False
521524 for variant_suffix in IMAGE_VARIANTS :
0 commit comments