summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/net/network_state.py4
-rw-r--r--cloudinit/net/tests/test_network_state.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py
index 95b064f0..4862bf91 100644
--- a/cloudinit/net/network_state.py
+++ b/cloudinit/net/network_state.py
@@ -710,6 +710,10 @@ class NetworkStateInterpreter(metaclass=CommandHandlerMeta):
def _v2_common(self, cfg):
LOG.debug('v2_common: handling config:\n%s', cfg)
for iface, dev_cfg in cfg.items():
+ if 'set-name' in dev_cfg:
+ set_name_iface = dev_cfg.get('set-name')
+ if set_name_iface:
+ iface = set_name_iface
if 'nameservers' in dev_cfg:
search = dev_cfg.get('nameservers').get('search', [])
dns = dev_cfg.get('nameservers').get('addresses', [])
diff --git a/cloudinit/net/tests/test_network_state.py b/cloudinit/net/tests/test_network_state.py
index 84e8308a..45e99171 100644
--- a/cloudinit/net/tests/test_network_state.py
+++ b/cloudinit/net/tests/test_network_state.py
@@ -52,6 +52,7 @@ network:
eth1:
match:
macaddress: '66:77:88:99:00:11'
+ set-name: "ens92"
nameservers:
search: [foo.local, bar.local]
addresses: [4.4.4.4]