← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~andybotting/cloud-init:openstack-disable-ipv4-on-config into cloud-init:master


Andy Botting has proposed merging ~andybotting/cloud-init:openstack-disable-ipv4-on-config into cloud-init:master.

Commit message:
Disable ephemeral ip setup for OpenStack on config
If apply_network_config is set to False on the OpenStack
datastore, we should not attempt to configure the ephemeral ipv4
address for fetching networking config.
LP: #1821102

Requested reviews:
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1821102 in cloud-init: "Cloud-init should not setup ephemeral ipv4 if apply_network_config is False for OpenStack"

For more details, see:
Your team cloud-init commiters is requested to review the proposed merge of ~andybotting/cloud-init:openstack-disable-ipv4-on-config into cloud-init:master.
diff --git a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py
index 4a01524..8214641 100644
--- a/cloudinit/sources/DataSourceOpenStack.py
+++ b/cloudinit/sources/DataSourceOpenStack.py
@@ -127,6 +127,10 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource):
             return False
         if self.perform_dhcp_setup:  # Setup networking in init-local stage.
+            # Don't setup ephemeral networking if apply_network_config is false
+            if util.is_false(self.ds_cfg.get('apply_network_config', True)):
+                LOG.debug("skipping ephemeral ipv4 setup")
+                return False
                 with EphemeralDHCPv4(self.fallback_interface):
                     results = util.log_time(