fix(contrib/terraform): do not add access_ip when not wanted (#9869)

pull/9915/head
Maxime Leroy 2023-03-22 04:56:36 +01:00 committed by GitHub
parent 97dfdcd8fe
commit 9a8bf0e38a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -298,6 +298,9 @@ def openstack_host(resource, module_name):
if 'floating_ip' in raw_attrs:
attrs['private_ipv4'] = raw_attrs['network.0.fixed_ip_v4']
if 'metadata.use_access_ip' in raw_attrs and raw_attrs['metadata.use_access_ip'] == "0":
attrs.pop('access_ip')
try:
if 'metadata.prefer_ipv6' in raw_attrs and raw_attrs['metadata.prefer_ipv6'] == "1":
attrs.update({