Skip to content

Commit

Permalink
AWS: Allow using "snapshot_accouts" from StArMap
Browse files Browse the repository at this point in the history
This commit updates the `push` command to include the
`snapshot_accounts` property from StArMap (whenever avaialble) to be
used in the `_push_upload` method.

Refers to RHELDST-29388
  • Loading branch information
JAVGan committed Feb 3, 2025
1 parent 1009389 commit 48ce477
Show file tree
Hide file tree
Showing 44 changed files with 214 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pubtools/_marketplacesvm/tasks/push/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def _push_upload(
pi,
custom_tags=mapped_item.get_tags_for_marketplace(marketplace),
accounts=meta.get("sharing_accounts", []),
snapshot_accounts=meta.get("snapshot_accounts", []),
ami_version_template=mapped_item.get_ami_version_template_for_mapped_item(
marketplace
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[ INFO] Retrieving the mappings for second_push_item from https://starmap-example.com
[ ERROR] No marketplace mappings found for second-build on cloud aws
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.description, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
Expand Down Expand Up @@ -49,6 +50,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -83,6 +85,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -117,6 +120,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -151,6 +155,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -185,6 +190,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -219,6 +225,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -253,6 +260,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -287,6 +295,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[ INFO] Retrieving the mappings for second_push_item from https://starmap-example.com
[ ERROR] No marketplace mappings found for test-build on cloud aws
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.description, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
Expand Down Expand Up @@ -49,6 +50,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -83,6 +85,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -117,6 +120,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -151,6 +155,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -185,6 +190,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -219,6 +225,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -253,6 +260,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down Expand Up @@ -287,6 +295,7 @@
[ DEBUG] Merging original release information with data from StArMap
[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}
[ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.opener, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.cloud_info, leaving it unset.
[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset.
Expand Down
Loading

0 comments on commit 48ce477

Please sign in to comment.