diff options
author | Wesley Wiedenmeier <wesley.wiedenmeier@gmail.com> | 2016-03-18 12:17:15 -0500 |
---|---|---|
committer | Wesley Wiedenmeier <wesley.wiedenmeier@gmail.com> | 2016-03-18 12:17:15 -0500 |
commit | 266717afcc01c9ae2f9b4e8cfc2db08aad83de97 (patch) | |
tree | a5a5c3051db727e5e92b48057b2d959f7a3bb882 /cloudinit | |
parent | b123a912448b74a1d51a50baed8d3d7edd4875d7 (diff) | |
download | vyos-cloud-init-266717afcc01c9ae2f9b4e8cfc2db08aad83de97.tar.gz vyos-cloud-init-266717afcc01c9ae2f9b4e8cfc2db08aad83de97.zip |
Handle static ip= entries by appending a static subnet to the device
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/net/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py index 2bfaf149..88d0061c 100644 --- a/cloudinit/net/__init__.py +++ b/cloudinit/net/__init__.py @@ -303,6 +303,9 @@ def load_klibc_net_cfg(data_mapping): entry_ns['subnets'].append({'type': 'dhcp4'}) if data_mapping.get('IPV6ADDR'): entry_ns['subnets'].append({'type': 'dhcp6'}) + elif data_mapping.get('PROTO') in ['static', 'none']: + entry_ns['subnets'].append( + {'type': 'static', 'address': data_mapping.get('IPV4ADDR')}) if data_mapping.get('IPV4ADDR'): entry_ns['address'] = data_mapping['IPV4ADDR'] |