Merge pull request #724 from AgarFu/master

Return the right dhcp_options id in the vpc response
This commit is contained in:
Steve Pulec 2016-10-10 08:53:03 -04:00 committed by GitHub
commit 094b10cea1
2 changed files with 13 additions and 2 deletions

View File

@ -50,7 +50,7 @@ CREATE_VPC_RESPONSE = """
<vpcId>{{ vpc.id }}</vpcId>
<state>pending</state>
<cidrBlock>{{ vpc.cidr_block }}</cidrBlock>
<dhcpOptionsId>dopt-1a2b3c4d2</dhcpOptionsId>
<dhcpOptionsId>{% if vpc.dhcp_options %}{{ vpc.dhcp_options.id }}{% else %}dopt-1a2b3c4d2{% endif %}</dhcpOptionsId>
<instanceTenancy>default</instanceTenancy>
<tagSet>
{% for tag in vpc.get_tags() %}
@ -74,7 +74,7 @@ DESCRIBE_VPCS_RESPONSE = """
<vpcId>{{ vpc.id }}</vpcId>
<state>{{ vpc.state }}</state>
<cidrBlock>{{ vpc.cidr_block }}</cidrBlock>
<dhcpOptionsId>dopt-7a8b9c2d</dhcpOptionsId>
<dhcpOptionsId>{% if vpc.dhcp_options %}{{ vpc.dhcp_options.id }}{% else %}dopt-7a8b9c2d{% endif %}</dhcpOptionsId>
<instanceTenancy>default</instanceTenancy>
<isDefault>{{ vpc.is_default }}</isDefault>
<tagSet>

View File

@ -321,3 +321,14 @@ def test_vpc_modify_enable_dns_hostnames():
response = vpc.describe_attribute(Attribute='enableDnsHostnames')
attr = response.get('EnableDnsHostnames')
attr.get('Value').should.be.ok
@mock_ec2
def test_vpc_associate_dhcp_options():
conn = boto.connect_vpc()
dhcp_options = conn.create_dhcp_options(SAMPLE_DOMAIN_NAME, SAMPLE_NAME_SERVERS)
vpc = conn.create_vpc("10.0.0.0/16")
conn.associate_dhcp_options(dhcp_options.id, vpc.id)
vpc.update()
dhcp_options.id.should.equal(vpc.dhcp_options_id)