Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested change to AmazonEbsSurrogate to fix unknown configuration key error and expected map got slice error #181

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/packerlicious/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,7 @@ class AmazonEbsSurrogate(PackerBuilder):
'instance_type': (str, True),
'region': (str, True),
'secret_key': (str, False),
'ami_root_device': ([BlockDeviceMapping], True),
'source_device_name': (str, True),
'ami_root_device': (BlockDeviceMapping, True),
'source_ami': (str, False),
'ami_block_device_mappings': ([BlockDeviceMapping], False),
'ami_architecture': (str, False),
Expand Down
12 changes: 4 additions & 8 deletions tests/packerlicious/test_builder_amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ def test_exactly_one_source_ami(self):
access_key="dummy-access-key",
secret_key="dummy-secret-key",
instance_type="t2.micro",
source_device_name="some_device",
region="us-east-1",
ami_root_device=[ami_root_dev],
ami_root_device=ami_root_dev,
)

with pytest.raises(ValueError) as excinfo:
Expand All @@ -215,9 +214,8 @@ def test_mutually_exclusive_security_group_ami(self):
access_key="dummy-access-key",
secret_key="dummy-secret-key",
instance_type="t2.micro",
source_device_name="some_device",
region="us-east-1",
ami_root_device=[ami_root_dev],
ami_root_device=ami_root_dev,
source_ami="dummy-source-ami",
security_group_id="sg-123",
security_group_ids=["sg-123", "sg-456"],
Expand All @@ -233,9 +231,8 @@ def test_mutually_exclusive_subnet_id(self):
access_key="dummy-access-key",
secret_key="dummy-secret-key",
instance_type="t2.micro",
source_device_name="some_device",
region="us-east-1",
ami_root_device=[ami_root_dev],
ami_root_device=ami_root_dev,
source_ami="dummy-source-ami",
subnet_id="subnet-12345def",
subnet_filter=builder.AmazonSubnetFilter(
Expand All @@ -258,9 +255,8 @@ def test_mutually_exclusive_vpc_id(self):
access_key="dummy-access-key",
secret_key="dummy-secret-key",
instance_type="t2.micro",
source_device_name="some_device",
region="us-east-1",
ami_root_device=[ami_root_dev],
ami_root_device=ami_root_dev,
source_ami="dummy-source-ami",
vpc_id="subnet-12345def",
vpc_filter=builder.AmazonVpcFilter(
Expand Down