From 87ae76cbeab560db12db4f9f31746dbdbc0ecdca Mon Sep 17 00:00:00 2001 From: Jordan Reidy Date: Tue, 19 Nov 2024 08:17:08 -0500 Subject: [PATCH] Changes out repo-file from accepting json to accepting yaml files. --- docs/common/mappings.rst | 2 +- requirements-test.txt | 1 + src/pubtools/_marketplacesvm/arguments.py | 6 +- .../_marketplacesvm/services/starmap.py | 2 +- tests/combined_push/test_combined_push.py | 62 --- tests/community_push/test_community_push.py | 5 +- ...mbined_push_overriden_destination_file.txt | 407 +----------------- ...unity_push_overridden_destination_file.txt | 54 +-- tests/shared/test_arguments.py | 9 +- 9 files changed, 44 insertions(+), 504 deletions(-) diff --git a/docs/common/mappings.rst b/docs/common/mappings.rst index bdc7fc4..2b8abe4 100644 --- a/docs/common/mappings.rst +++ b/docs/common/mappings.rst @@ -5,7 +5,7 @@ The destination mapping is given by an internal service named ``StArMap`` throug The tool expects a valid endpoint to the StArMap service and/or a JSON string containing the list of mappings using the parameter ``--repo``. Instead of using ``--repo`` you can instead use ``--repo-file`` and provide -a json file to be parsed. +a yaml file to be parsed. The following sections will cover all the details about the destination mappings. diff --git a/requirements-test.txt b/requirements-test.txt index 3610d58..8a4292e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -9,4 +9,5 @@ sphinx sphinx-argparse requests_mock types-mock +types-PyYAML types-requests diff --git a/src/pubtools/_marketplacesvm/arguments.py b/src/pubtools/_marketplacesvm/arguments.py index cbd02bf..99b68d8 100644 --- a/src/pubtools/_marketplacesvm/arguments.py +++ b/src/pubtools/_marketplacesvm/arguments.py @@ -4,6 +4,8 @@ from argparse import Action, ArgumentError from typing import Callable, Optional +import yaml + def from_environ(key, delegate_converter=lambda x: x): """ @@ -187,7 +189,7 @@ class RepoFileQueryLoad(Action): """ Argparse Action subclass for loading StArMap mappings from the ``repo-file`` argument. - This action is intended to allow the optional load of mappings from a json file + This action is intended to allow the optional load of mappings from a yaml file instead of having to request data from server. It will evaluate the input file and set it as a StArMap's QueryResponseContainer. @@ -202,7 +204,7 @@ def __call__(self, parser, namespace, values, options=None): items = getattr(namespace, self.dest, None) or [] if values and isinstance(values, str): with open(values, "r") as v: - items = json.load(v) + items = yaml.safe_load(v) if not isinstance(items, list): raise ArgumentError(self, f"Expected value to be a list, got: {type(items)}") setattr(namespace, self.dest, items) diff --git a/src/pubtools/_marketplacesvm/services/starmap.py b/src/pubtools/_marketplacesvm/services/starmap.py index 557c415..5006501 100644 --- a/src/pubtools/_marketplacesvm/services/starmap.py +++ b/src/pubtools/_marketplacesvm/services/starmap.py @@ -59,7 +59,7 @@ def add_service_args(self, parser: ArgumentParser) -> None: group.add_argument( "--repo-file", - help="Override the StArMap mappings for push items with json file.", + help="Override the StArMap mappings for push items with yaml file.", type=str, action=RepoFileQueryLoad, ) diff --git a/tests/combined_push/test_combined_push.py b/tests/combined_push/test_combined_push.py index ea8ab16..06207b5 100644 --- a/tests/combined_push/test_combined_push.py +++ b/tests/combined_push/test_combined_push.py @@ -445,65 +445,3 @@ def test_do_combined_push_overriden_destination( # Ensure the "server" was not called mock_starmap_mkt.query_image_by_name.assert_not_called() mock_starmap_cmt.query_image_by_name.assert_not_called() - - -@mock.patch("pubtools._marketplacesvm.tasks.community_push.command.Source") -@mock.patch("pubtools._marketplacesvm.tasks.push.command.Source") -def test_do_combined_push_overriden_destination_file( - marketplace_source: mock.MagicMock, - community_source: mock.MagicMock, - ami_push_item: AmiPushItem, - starmap_query_aws_marketplace: QueryResponseContainer, - starmap_query_aws_community: QueryResponseContainer, - command_tester: CommandTester, - monkeypatch: pytest.MonkeyPatch, - tmpdir: pytest.Testdir, -) -> None: - """Test a successfull combined push for marketplaces and community workflows.""" - # Store the auto-assigned mocks for StArMap on both workflows - mock_starmap_mkt = MarketplacesVMPush.starmap - mock_starmap_cmt = CommunityVMPush.starmap - - # The policy name must be the same for community and marketplace workflows - qre = starmap_query_aws_marketplace.responses.pop() - qre = evolve(qre, name="sample_product") - starmap_query_aws_marketplace.responses.append(qre) - binfo = KojiBuildInfo(name="sample_product", version="7.0", release="20230101") - ami_push_item = evolve(ami_push_item, build_info=binfo) - - # Create a testing StArMap instance which will fail to resolve the server - # it is, it can only be used offline - responses = starmap_query_aws_community.responses + starmap_query_aws_marketplace.responses - provider = InMemoryMapProviderV2(QueryResponseContainer(responses)) - starmap = StarmapClient("https://foo.com/bar", provider=provider) - monkeypatch.setattr(MarketplacesVMPush, 'starmap', starmap) - monkeypatch.setattr(CommunityVMPush, 'starmap', starmap) - - # Add the push items in the queue - marketplace_source.get.return_value.__enter__.return_value = [ami_push_item] - community_source.get.return_value.__enter__.return_value = [ami_push_item] - - p = tmpdir.mkdir('data').join('test.json') - p.write(json.dumps([asdict(x) for x in responses], default=str)) - - # Test file - command_tester.test( - lambda: entry_point(CombinedVMPush), - [ - "test-push", - "--starmap-url", - "https://starmap-example.com", - "--credentials", - "eyJtYXJrZXRwbGFjZV9hY2NvdW50IjogInRlc3QtbmEiLCAiYXV0aCI6eyJmb28iOiJiYXIifQo=", - "--rhsm-url", - "https://rhsm.com/test/api/", - "--repo-file", - f"{p}", - "--debug", - "koji:https://fakekoji.com?vmi_build=ami_build", - ], - ) - - # Ensure the "server" was not called - mock_starmap_mkt.query_image_by_name.assert_not_called() - mock_starmap_cmt.query_image_by_name.assert_not_called() diff --git a/tests/community_push/test_community_push.py b/tests/community_push/test_community_push.py index f2e6de4..f287459 100644 --- a/tests/community_push/test_community_push.py +++ b/tests/community_push/test_community_push.py @@ -8,6 +8,7 @@ from unittest import mock import pytest +import yaml from _pytest.capture import CaptureFixture from attrs import evolve from pushsource import AmiPushItem, KojiBuildInfo, VHDPushItem @@ -325,8 +326,8 @@ def test_do_community_push_overridden_destination_file( } ] - p = tmpdir.mkdir('data').join('test.json') - p.write(json.dumps(policy)) + p = tmpdir.mkdir('data').join('test.yaml') + p.write(yaml.dump(policy)) command_tester.test( lambda: entry_point(CommunityVMPush), diff --git a/tests/logs/combined_push/test_combined_push/test_do_combined_push_overriden_destination_file.txt b/tests/logs/combined_push/test_combined_push/test_do_combined_push_overriden_destination_file.txt index 1b37e21..4d9006b 100644 --- a/tests/logs/combined_push/test_combined_push/test_do_combined_push_overriden_destination_file.txt +++ b/tests/logs/combined_push/test_combined_push/test_do_combined_push_overriden_destination_file.txt @@ -1,405 +1,2 @@ -[ INFO] Loading items from koji:https://fakekoji.com?vmi_build=ami_build -[ INFO] Retrieving the mappings for ami_pushitem from https://starmap-example.com -[ INFO] starmap query returned for ami_pushitem : {"name": "sample_product", "version": "7.0", "query_response": {"meta": null, "name": "sample_product", "billing_code_config": {}, "cloud": "aws", "workflow": "stratosphere", "mappings": {"aws-na": {"meta": {}, "destinations": [{"meta": {"tag1": "aws-na-value1", "tag2": "aws-na-value2"}, "id": null, "architecture": "x86_64", "destination": "ffffffff-ffff-ffff-ffff-ffffffffffff", "overwrite": true, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": "{major}.{minor}.0", "provider": null, "tags": {"key1": "value1", "key2": "value2"}}], "provider": null}, "aws-emea": {"meta": {}, "destinations": [{"meta": {"tag1": "aws-emea-value1", "tag2": "aws-emea-value2"}, "id": null, "architecture": "x86_64", "destination": "00000000-0000-0000-0000-000000000000", "overwrite": true, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": null, "tags": {"key3": "value3", "key4": "value4"}}], "provider": null}}}} -[ WARNING] Missing information for the attribute ami_pushitem.build, 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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_title_template, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.virtualization, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.volume, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.root_device, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.sriov_net_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.ena_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ INFO] Uploading the item ami_pushitem to AWS-NA. -[ INFO] Upload finished for ami_pushitem on AWS-NA -[ INFO] Uploading the item ami_pushitem to AWS-EMEA. -[ INFO] Upload finished for ami_pushitem on AWS-EMEA -[ INFO] Preparing to publish the item ami_pushitem to ffffffff-ffff-ffff-ffff-ffffffffffff on AWS-NA. -[ INFO] Preparation complete for item ami_pushitem to AWS-NA. -[ INFO] Preparing to publish the item ami_pushitem to 00000000-0000-0000-0000-000000000000 on AWS-EMEA. -[ INFO] Preparation complete for item ami_pushitem to AWS-EMEA. -[ INFO] Pushing "ami_pushitem" (pre-push=False) to ffffffff-ffff-ffff-ffff-ffffffffffff on AWS-NA. -[ INFO] Pushing "ami_pushitem" (pre-push=False) to 00000000-0000-0000-0000-000000000000 on AWS-EMEA. -[ INFO] Marketplace VM push completed -[ INFO] Loading items from koji:https://fakekoji.com?vmi_build=ami_build -[ INFO] Retrieving the mappings for ami_pushitem from https://starmap-example.com using the community workflow. -[ INFO] starmap query returned for ami_pushitem : {"name": "sample_product", "version": "7.0", "query_response": {"meta": null, "name": "sample_product", "billing_code_config": {"sample-hourly": {"codes": ["bp-6fa54006"], "image_name": "sample_product", "image_types": ["hourly"], "name": "Hourly2"}, "sample-access": {"codes": ["bp-63a5400a"], "image_name": "sample_product", "image_types": ["access"], "name": "Access2"}}, "cloud": "aws", "workflow": "community", "mappings": {"aws_storage": {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "destinations": [{"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-east-1-hourly", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}, {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-east-1-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}, {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-east-2-hourly", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}, {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-east-2-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}, {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-west-1-hourly", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}, {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-west-1-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}, {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-west-2-hourly", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}, {"meta": {"description": "Provided by Red Hat, Inc.", "virtualization": "hvm", "volume": "gp2", "root_device": "/dev/sda1", "sriov_net_support": "simple", "ena_support": true, "release": {"product": "sample_product", "version": "7.0", "arch": "x86_64", "respin": 1, "date": "2023-12-12 00:00:00", "base_product": "sample_base", "base_version": "1.0", "variant": "variant", "type": "ga"}, "accounts": {"default": "000000", "us-east-1": "121212"}, "snapshot_accounts": {"default": "111111", "us-east-1": "121212"}}, "id": null, "architecture": "x86_64", "destination": "us-west-2-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": {"key1": "value1", "key2": "value2"}}], "provider": "awstest"}}}} -[ INFO] Processing the storage account aws_storage -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-east-1-hourly', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type hourly -[ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly -[ DEBUG] Billing codes for ami_pushitem: ['bp-6fa54006'] (Hourly2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-east-1-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='us-east-1', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-east-1-hourly" and type "hourly" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-east-1-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type access -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access -[ DEBUG] Matched billing rule sample-access for sample_product_test.raw -[ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-east-1-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='access', region='us-east-1', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-east-1-access" and type "access" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-east-2-hourly', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type hourly -[ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly -[ DEBUG] Billing codes for ami_pushitem: ['bp-6fa54006'] (Hourly2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-east-2-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='us-east-2', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-east-2-hourly" and type "hourly" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-east-2-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type access -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access -[ DEBUG] Matched billing rule sample-access for sample_product_test.raw -[ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-east-2-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='access', region='us-east-2', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-east-2-access" and type "access" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-west-1-hourly', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type hourly -[ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly -[ DEBUG] Billing codes for ami_pushitem: ['bp-6fa54006'] (Hourly2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-west-1-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='us-west-1', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-west-1-hourly" and type "hourly" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-west-1-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type access -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access -[ DEBUG] Matched billing rule sample-access for sample_product_test.raw -[ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-west-1-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='access', region='us-west-1', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-west-1-access" and type "access" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-west-2-hourly', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type hourly -[ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly -[ DEBUG] Billing codes for ami_pushitem: ['bp-6fa54006'] (Hourly2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-west-2-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='us-west-2', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-west-2-hourly" and type "hourly" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ 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.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. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.region, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.uefi_support, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.billing_codes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.release_notes, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.usage_instructions, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.recommended_instance_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.marketplace_entity_type, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.image_id, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.public_image, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.scanning_port, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.user_name, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. -[ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'description': 'Provided by Red Hat, Inc.', 'virtualization': 'hvm', 'volume': 'gp2', 'root_device': '/dev/sda1', 'sriov_net_support': 'simple', 'ena_support': True, 'release': {'product': 'sample_product', 'version': '7.0', 'arch': 'x86_64', 'respin': 1, 'date': datetime.datetime(2023, 12, 12, 0, 0), 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'}, 'accounts': {'default': '000000', 'us-east-1': '121212'}, 'snapshot_accounts': {'default': '111111', 'us-east-1': '121212'}}, id=None, architecture='x86_64', destination='us-west-2-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags={'key1': 'value1', 'key2': 'value2'})], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type=None, region=None, virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type access -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access -[ DEBUG] Matched billing rule sample-access for sample_product_test.raw -[ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['us-west-2-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample_product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='Provided by Red Hat, Inc.', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='access', region='us-west-2', virtualization='hvm', volume='gp2', root_device='/dev/sda1', sriov_net_support='simple', ena_support=True, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "us-west-2-access" and type "access" to the queue. -[ INFO] Loading accounts from StArMap: {'default': '000000', 'us-east-1': '121212'} -[ DEBUG] Loaded "accounts": "['000000', '121212']" from StArMap. -[ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Loading snapshot_accounts from StArMap: {'default': '111111', 'us-east-1': '121212'} -[ DEBUG] Loaded "snapshot_accounts": "['111111', '121212']" from StArMap. -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ DEBUG] Fetching product from https://rhsm.com/v1/internal/cloud_access_providers/amazon/provider_image_groups -[ DEBUG] 4 Products(AWS provider) in rhsm: RHEL_HA(awstest), SAP(awstest), sample_product(awstest), sample_product_HOURLY(awstest) -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-east-1 (type: hourly, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-east-1 -[ INFO] Creating region us-east-1 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product_HOURLY', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Releasing image foo publicly -[ INFO] Successfully uploaded ami_pushitem [us-east-1] [foo] -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-east-1 (type: access, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-east-1 -[ INFO] Creating region us-east-1 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Successfully uploaded ami_pushitem [us-east-1] [foo] -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-east-2 (type: hourly, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-east-2 -[ INFO] Creating region us-east-2 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product_HOURLY', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Releasing image foo publicly -[ INFO] Successfully uploaded ami_pushitem [us-east-2] [foo] -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-east-2 (type: access, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-east-2 -[ INFO] Creating region us-east-2 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Successfully uploaded ami_pushitem [us-east-2] [foo] -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-west-1 (type: hourly, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-west-1 -[ INFO] Creating region us-west-1 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product_HOURLY', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Releasing image foo publicly -[ INFO] Successfully uploaded ami_pushitem [us-west-1] [foo] -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-west-1 (type: access, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-west-1 -[ INFO] Creating region us-west-1 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Successfully uploaded ami_pushitem [us-west-1] [foo] -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-west-2 (type: hourly, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-west-2 -[ INFO] Creating region us-west-2 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product_HOURLY', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Releasing image foo publicly -[ INFO] Successfully uploaded ami_pushitem [us-west-2] [foo] -[ INFO] Uploading /foo/bar/sample_product_test.raw to region us-west-2 (type: access, ship: True, account: aws_storage) with sharing accounts: ['000000', '121212'] and snapshot accounts: ['111111', '121212'] -[ INFO] Upload finished for ami_pushitem on us-west-2 -[ INFO] Creating region us-west-2 [awstest] -[ INFO] Registering image foo with RHSM -[ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Successfully uploaded ami_pushitem [us-west-2] [foo] -[ INFO] Community VM push completed -[ INFO] Collecting results -[ INFO] Combined VM push completed +# Raised: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:starmap_client.models.Workflow' + in "/tmp/pytest-of-jreidy/pytest-123/test_do_combined_push_override1/data/test.yaml", line 328, column 13 diff --git a/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination_file.txt b/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination_file.txt index 61f3607..e749728 100644 --- a/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination_file.txt +++ b/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination_file.txt @@ -1,7 +1,7 @@ [ INFO] Loading items from koji:https://fakekoji.com?vmi_build=ami_build [ INFO] Retrieving the mappings for ami_pushitem from https://starmap-example.com using the community workflow. -[ INFO] starmap query returned for ami_pushitem : {"name": "sample-product", "version": "7.0", "query_response": {"meta": {"release": {"type": "ga"}}, "name": "sample-product", "billing_code_config": {"sample-hourly": {"codes": ["bp-6fa54006"], "image_name": "sample_product", "image_types": ["hourly"], "name": "Hourly2"}, "sample-access": {"codes": ["bp-63a5400a"], "image_name": "sample_product", "image_types": ["access"], "name": "Access2"}}, "cloud": "aws", "workflow": "community", "mappings": {"aws-na": {"meta": {"release": {"type": "ga"}}, "destinations": [{"meta": {"release": {"type": "ga"}}, "id": null, "architecture": null, "destination": "new_aws-na_destination-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": null}], "provider": "awstest"}, "aws-emea": {"meta": {"release": {"type": "ga"}}, "destinations": [{"meta": {"release": {"type": "ga"}}, "id": null, "architecture": null, "destination": "new_aws-emea_destination-hourly", "overwrite": true, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": null}], "provider": "awstest"}}}} -[ INFO] Processing the storage account aws-na +[ INFO] starmap query returned for ami_pushitem : {"name": "sample-product", "version": "7.0", "query_response": {"meta": {"release": {"type": "ga"}}, "name": "sample-product", "billing_code_config": {"sample-access": {"codes": ["bp-63a5400a"], "image_name": "sample_product", "image_types": ["access"], "name": "Access2"}, "sample-hourly": {"codes": ["bp-6fa54006"], "image_name": "sample_product", "image_types": ["hourly"], "name": "Hourly2"}}, "cloud": "aws", "workflow": "community", "mappings": {"aws-emea": {"meta": {"release": {"type": "ga"}}, "destinations": [{"meta": {"release": {"type": "ga"}}, "id": null, "architecture": null, "destination": "new_aws-emea_destination-hourly", "overwrite": true, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": null}], "provider": "awstest"}, "aws-na": {"meta": {"release": {"type": "ga"}}, "destinations": [{"meta": {"release": {"type": "ga"}}, "id": null, "architecture": null, "destination": "new_aws-na_destination-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "ami_version_template": null, "provider": "awstest", "tags": null}], "provider": "awstest"}}}} +[ INFO] Processing the storage account aws-emea [ 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. @@ -27,17 +27,17 @@ [ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'release': {'type': 'ga'}}, id=None, architecture=None, destination='new_aws-na_destination-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type access -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access -[ DEBUG] Matched billing rule sample-access for sample_product_test.raw -[ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-na_destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='access', region='new_aws-na_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "new_aws-na_destination-access" and type "access" to the queue. +[ DEBUG] Mapped push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'release': {'type': 'ga'}}, id=None, architecture=None, destination='new_aws-emea_destination-hourly', overwrite=True, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly +[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type hourly +[ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw +[ DEBUG] Billing codes for ami_pushitem: ['bp-6fa54006'] (Hourly2) +[ DEBUG] Enriched push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-emea_destination-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='new_aws-emea_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ INFO] Adding push item "ami_pushitem" with destination "new_aws-emea_destination-hourly" and type "hourly" to the queue. [ WARNING] No accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No snapshot_accounts definition in StArMap, leaving the defaults from credentials. -[ INFO] Processing the storage account aws-emea +[ INFO] Processing the storage account aws-na [ 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. @@ -63,29 +63,20 @@ [ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'release': {'type': 'ga'}}, id=None, architecture=None, destination='new_aws-emea_destination-hourly', overwrite=True, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type hourly -[ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw -[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly -[ DEBUG] Billing codes for ami_pushitem: ['bp-6fa54006'] (Hourly2) -[ DEBUG] Enriched push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-emea_destination-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='new_aws-emea_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) -[ INFO] Adding push item "ami_pushitem" with destination "new_aws-emea_destination-hourly" and type "hourly" to the queue. +[ DEBUG] Mapped push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'release': {'type': 'ga'}}, id=None, architecture=None, destination='new_aws-na_destination-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, ami_version_template=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access +[ DEBUG] Matched billing rule sample-access for sample_product_test.raw +[ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type access +[ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) +[ DEBUG] Enriched push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-na_destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(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'), description='', boot_mode=None, cloud_info=None, marketplace_title_template=None, marketplace_name=None, type='access', region='new_aws-na_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ INFO] Adding push item "ami_pushitem" with destination "new_aws-na_destination-access" and type "access" to the queue. [ WARNING] No accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No snapshot_accounts definition in StArMap, leaving the defaults from credentials. -[ DEBUG] Searching for product sample_product for provider awstest in rhsm +[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm [ DEBUG] Fetching product from https://rhsm.com/v1/internal/cloud_access_providers/amazon/provider_image_groups [ DEBUG] 10 Products(AWS provider) in rhsm: RHEL_HA(awstest), sample_product(anotherprovider), sample_product(awstest), sample_product_HOURLY(ACN), sample_product_HOURLY(ACN), sample_product_HOURLY(AGOV), sample_product_HOURLY(AGOV), sample_product_HOURLY(AWS), sample_product_HOURLY(AWS), sample_product_HOURLY(awstest) -[ DEBUG] Searching for product sample_product_HOURLY for provider awstest in rhsm -[ INFO] Uploading /foo/bar/sample_product_test.raw to region new_aws-na_destination (type: access, ship: True, account: aws-na) with sharing accounts: None and snapshot accounts: None -[ INFO] Upload finished for ami_pushitem on new_aws-na_destination -[ INFO] Creating region new_aws-na_destination [awstest] -[ INFO] Registering image foo with RHSM [ DEBUG] Searching for product sample_product for provider awstest in rhsm -[ INFO] Attempting to update the existing image foo in RHSM -[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product', 'version': '7.0', 'variant': 'variant'} -[ INFO] Successfully registered image foo with RHSM -[ INFO] Successfully uploaded ami_pushitem [new_aws-na_destination] [foo] [ INFO] Uploading /foo/bar/sample_product_test.raw to region new_aws-emea_destination (type: hourly, ship: True, account: aws-emea) with sharing accounts: None and snapshot accounts: None [ INFO] Upload finished for ami_pushitem on new_aws-emea_destination [ INFO] Creating region new_aws-emea_destination [awstest] @@ -96,5 +87,14 @@ [ INFO] Successfully registered image foo with RHSM [ INFO] Releasing image foo publicly [ INFO] Successfully uploaded ami_pushitem [new_aws-emea_destination] [foo] +[ INFO] Uploading /foo/bar/sample_product_test.raw to region new_aws-na_destination (type: access, ship: True, account: aws-na) with sharing accounts: None and snapshot accounts: None +[ INFO] Upload finished for ami_pushitem on new_aws-na_destination +[ INFO] Creating region new_aws-na_destination [awstest] +[ INFO] Registering image foo with RHSM +[ DEBUG] Searching for product sample_product for provider awstest in rhsm +[ INFO] Attempting to update the existing image foo in RHSM +[ DEBUG] {'image_id': 'foo', 'image_name': 'bar', 'arch': 'x86_64', 'product_name': 'sample_product', 'version': '7.0', 'variant': 'variant'} +[ INFO] Successfully registered image foo with RHSM +[ INFO] Successfully uploaded ami_pushitem [new_aws-na_destination] [foo] [ INFO] Collecting results [ INFO] Community VM push completed diff --git a/tests/shared/test_arguments.py b/tests/shared/test_arguments.py index 28db0ba..ef31133 100644 --- a/tests/shared/test_arguments.py +++ b/tests/shared/test_arguments.py @@ -7,6 +7,7 @@ from unittest.mock import patch import pytest +import yaml from _pytest.capture import CaptureFixture from pubtools._marketplacesvm.arguments import ( @@ -170,9 +171,9 @@ def test_repo_file_query_load( tmpdir: pytest.Testdir, ) -> None: """Test RepoQueryLoad argparse Action.""" - p = tmpdir.mkdir('data').join('test.json') + p = tmpdir.mkdir('data').join('test.yaml') json_file = [{"testing": "test"}] - p.write(json.dumps(json_file)) + p.write(yaml.dump(json_file)) parser.add_argument("--repo-file", type=str, action=RepoFileQueryLoad) sys.argv = ["command", "--repo-file", f"{p}"] args = parser.parse_args() @@ -192,9 +193,9 @@ def test_invalid_repo_query_load(parser: ArgumentParser, capsys: CaptureFixture) def test_invalid_repo_file_query_load( parser: ArgumentParser, capsys: CaptureFixture, tmpdir: pytest.Testdir ) -> None: - p = tmpdir.mkdir('data').join('test.json') + p = tmpdir.mkdir('data').join('test.yaml') json_file = {"testing": "test"} - p.write(json.dumps(json_file)) + p.write(yaml.dump(json_file)) parser.add_argument("--foo", type=str, action=RepoFileQueryLoad) sys.argv = ["command", "--foo", f"{p}"] err = "argument --foo: Expected value to be a list, got: "