Skip to content

Commit

Permalink
Fixing netword when using set-name
Browse files Browse the repository at this point in the history
  • Loading branch information
pradipd committed Nov 1, 2021
1 parent 03ee10c commit 756742a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cloudinit/net/networkd.py
Expand Up @@ -238,7 +238,15 @@ def _render_content(self, ns):
name = iface['name']
# network state doesn't give dhcp domain info
# using ns.config as a workaround here
self.dhcp_domain(ns.config['ethernets'][name], cfg)
found = False
for k, v in ns.config['ethernets'].items():
if v.get('set-name') is name:
self.dhcp_domain(ns.config['ethernets'][k], cfg)
found = True
break

if not found:
LOG.debug('failed to find a configuration with interface name %s', name)

ret_dict.update({link: cfg.get_final_conf()})

Expand Down

0 comments on commit 756742a

Please sign in to comment.