troposphere
troposphere copied to clipboard
When using ec2.VpnTunnelOptionsSpecification, report error:compile() missing required argument 'filename' (pos 2)
I am using troposphere version 4.3.2 The issue occurs in this code section:
vpn_tunnel_option_props = self.filter_parameters(
vpn_option.items(), ec2.VpnTunnelOptionsSpecification
)
after I ran it an error occured: compile() missing required argument 'filename' (pos 2) But it works in troposphere version 3.2.2 I find that troposphere uses re.complile() in the old versions(v3), but the Python system function compile() is used in the new versions(v4), which caused this problem. Is this a bug?
def vpn_tunnel_inside_cidr(cidr):
"""
Property: VpnTunnelOptionsSpecification.TunnelInsideCidr
"""
cidr_match_re = compile(
r"^169\.254\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)"
r"\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\/30$"
)