summaryrefslogtreecommitdiff
path: root/cloudinit/sources/helpers/vmware/imc/config_nic.py
diff options
context:
space:
mode:
authorPengpeng Sun <pengpengs@vmware.com>2018-08-28 22:52:28 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2018-08-28 22:52:28 +0000
commit9c35f9762028b8bf15cdcd6b42c0fafc233ddda3 (patch)
treee52f4db8c15b30576245823731f723d6a8ee4465 /cloudinit/sources/helpers/vmware/imc/config_nic.py
parent2320c3de2712c2f320b0d8af4aa129219cc2ad04 (diff)
downloadvyos-cloud-init-9c35f9762028b8bf15cdcd6b42c0fafc233ddda3.tar.gz
vyos-cloud-init-9c35f9762028b8bf15cdcd6b42c0fafc233ddda3.zip
VMWare: Fix a network config bug in vm with static IPv4 and no gateway.
The issue is when customize a VM with static IPv4 and without gateway, it will still extend route list and will loop a gateways list which is None. This fix is to make sure when no gateway is here, it will not extend route list. LP: #1766538
Diffstat (limited to 'cloudinit/sources/helpers/vmware/imc/config_nic.py')
-rw-r--r--cloudinit/sources/helpers/vmware/imc/config_nic.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/sources/helpers/vmware/imc/config_nic.py b/cloudinit/sources/helpers/vmware/imc/config_nic.py
index 3ef8c624..e1890e23 100644
--- a/cloudinit/sources/helpers/vmware/imc/config_nic.py
+++ b/cloudinit/sources/helpers/vmware/imc/config_nic.py
@@ -164,7 +164,7 @@ class NicConfigurator(object):
return ([subnet], route_list)
# Add routes if there is no primary nic
- if not self._primaryNic:
+ if not self._primaryNic and v4.gateways:
route_list.extend(self.gen_ipv4_route(nic,
v4.gateways,
v4.netmask))