Skip to content

Commit

Permalink
Support python 3.12 for terraform.py in regex expression (kubernetes-…
Browse files Browse the repository at this point in the history
  • Loading branch information
enrico9034 authored and kpoxo6op committed Dec 27, 2024
1 parent 17f3a51 commit 05d6713
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/terraform/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def iterresources(filenames):
def _clean_dc(dcname):
# Consul DCs are strictly alphanumeric with underscores and hyphens -
# ensure that the consul_dc attribute meets these requirements.
return re.sub('[^\w_\-]', '-', dcname)
return re.sub(r'[^\w_\-]', '-', dcname)


def iterhosts(resources):
Expand Down Expand Up @@ -304,7 +304,7 @@ def openstack_host(resource, module_name):
try:
if 'metadata.prefer_ipv6' in raw_attrs and raw_attrs['metadata.prefer_ipv6'] == "1":
attrs.update({
'ansible_host': re.sub("[\[\]]", "", raw_attrs['access_ip_v6']),
'ansible_host': re.sub(r"[\[\]]", "", raw_attrs['access_ip_v6']),
'publicly_routable': True,
})
else:
Expand Down

0 comments on commit 05d6713

Please sign in to comment.