33import logging
44import os
55from collections import namedtuple
6- from typing import Any , Dict , Iterator , List , Optional , TypedDict , cast
6+ from typing import Any , Dict , Iterator , List , Optional , Tuple , TypedDict , cast
77
88from attrs import asdict , evolve
99from more_executors import Executors
@@ -358,7 +358,7 @@ def _upload(
358358 push_item : VMIPushItem ,
359359 custom_tags : Optional [Dict [str , str ]] = None ,
360360 ** kwargs ,
361- ) -> VMIPushItem :
361+ ) -> Tuple [ VMIPushItem , str ] :
362362 # First we do the AMI upload in a similar way of the base class
363363 ship = not self .args .pre_push
364364 container = "%s-%s" % (self .args .container_prefix , push_item .region )
@@ -395,7 +395,7 @@ def _upload(
395395 stack_info = True ,
396396 )
397397 pi = evolve (push_item , state = State .UPLOADFAILED )
398- return pi
398+ return pi , marketplace
399399
400400 # Then, if we're shipping the community image, we should update the RHSM
401401 # and change the the AWS group to "all" for the uploaded image
@@ -418,12 +418,12 @@ def _upload(
418418 except Exception as exc :
419419 log .exception ("Failed to publish %s: %s" , push_item .name , str (exc ), stack_info = True )
420420 pi = evolve (push_item , state = State .NOTPUSHED )
421- return pi
421+ return pi , marketplace
422422
423423 # Finally, if everything went well we return the updated push item
424424 log .info ("Successfully uploaded %s [%s] [%s]" , pi .name , pi .region , image .id )
425425 pi = evolve (pi , state = State .PUSHED )
426- return pi
426+ return pi , marketplace
427427
428428 def _check_product_in_rhsm (self , enriched_push_items : List [EnrichedPushItem ]) -> bool :
429429 for enriched_item in enriched_push_items :
@@ -466,8 +466,12 @@ def _push_to_community(self, push_queue: Iterator[UploadParams]) -> List[Dict[st
466466 "state" : pi .state ,
467467 "image_id" : pi .image_id ,
468468 "image_name" : name_from_push_item (pi ),
469+ "cloud_info" : {
470+ "account" : marketplace ,
471+ "provider" : "aws" ,
472+ },
469473 }
470- for pi in upload_result
474+ for pi , marketplace in upload_result
471475 ]
472476
473477 def _data_to_upload (
0 commit comments