Skip to content

Commit 9510a31

Browse files
committed
ec2: correctly map vpn error message
1 parent a88c21d commit 9510a31

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/test_ec2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ def test_vpn_conn_tunnel_options_specification(self):
143143
PreSharedKey="0SAD_FEA_SDF", TunnelInsideCidr="192.168.16.0/30"
144144
)
145145

146+
def test_vpn_port_validator(self):
147+
for port in (443, 1194):
148+
vec2.validate_clientvpnendpoint_vpnport(port)
149+
with self.assertRaises(ValueError):
150+
vec2.validate_clientvpnendpoint_vpnport(22)
151+
146152
def test_validate_placement_strategy(self):
147153
for s in ("cluster", "spread", "partition"):
148154
vec2.validate_placement_strategy(s)

troposphere/validators/ec2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def validate_clientvpnendpoint_vpnport(vpnport):
188188
if vpnport not in VALID_CLIENTVPNENDPOINT_VPNPORT:
189189
raise ValueError(
190190
"ClientVpnEndpoint VpnPort must be one of: %s"
191-
% ", ".join(VALID_CLIENTVPNENDPOINT_VPNPORT)
191+
% ", ".join(map(str, VALID_CLIENTVPNENDPOINT_VPNPORT))
192192
)
193193
return vpnport
194194

0 commit comments

Comments
 (0)