From db4433102dbb7668292a5a1b473a4bf760e5dae0 Mon Sep 17 00:00:00 2001 From: uhryniuk Date: Tue, 25 Nov 2025 15:03:04 -0600 Subject: [PATCH] fix(oracle): update condition for setting public ips The Oracle provider in pycloudlib will attempt to assign a public IP to the instance. However, the current implementation assumed that the subnet was always public but this may not be true. To remedy this, we explicitly add checks that the subnet allows public ips to be assigned, then we set that configuration in the vnic details" --- VERSION | 2 +- pycloudlib/oci/cloud.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index ae096aa2..e7d802d5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1!10.14.0 +1!10.14.1 diff --git a/pycloudlib/oci/cloud.py b/pycloudlib/oci/cloud.py index 901503e7..9aeae65d 100644 --- a/pycloudlib/oci/cloud.py +++ b/pycloudlib/oci/cloud.py @@ -313,12 +313,14 @@ def launch( subnet = self.network_client.get_subnet(subnet_id).data vnic_kwargs = {} - # When no IPv4 CIDR is present, the value is assigned to '' str instead of None. - if "null" not in subnet.cidr_block: - vnic_kwargs["assign_public_ip"] = True - - if subnet.ipv6_cidr_block is not None: - vnic_kwargs["assign_ipv6_ip"] = True + # Only assign public IP if the subnet allows it + if not subnet.prohibit_public_ip_on_vnic: + # When no IPv4 CIDR is present, the value is assigned to '' str instead of None. + if "null" not in subnet.cidr_block: + vnic_kwargs["assign_public_ip"] = True + + if subnet.ipv6_cidr_block is not None: + vnic_kwargs["assign_ipv6_ip"] = True default_metadata = { "ssh_authorized_keys": self.key_pair.public_key_content,