From 244f2117df83590b06e5a1fc747fef3343562570 Mon Sep 17 00:00:00 2001 From: zsdc Date: Tue, 3 May 2022 18:49:46 +0300 Subject: T4407: Applied workaround for network-config v2 Network-config v2 is broken is upstream. See the bug report for details: https://bugs.launchpad.net/cloud-init/+bug/1906187 This workaround allows us to use it again in our module. --- cloudinit/config/cc_vyos.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cloudinit/config/cc_vyos.py b/cloudinit/config/cc_vyos.py index a7f75316..408a2ea9 100644 --- a/cloudinit/config/cc_vyos.py +++ b/cloudinit/config/cc_vyos.py @@ -502,6 +502,12 @@ def handle(name, cfg, cloud, log, _args): else: init_stage = Init() (netcfg, netcfg_src) = init_stage._find_networking_config() + # Depending on Network-config version (and maybe something else) + # Cloud-init may provide output here in different formats. That + # is why we need to add this additional validation and conversion + # to what we expect to see in the end. Most likely, the reason is + # in: https://bugs.launchpad.net/cloud-init/+bug/1906187 + netcfg = netcfg.get('network', netcfg) logger.debug("Network-config: {}".format(netcfg)) logger.debug("Network-config source: {}".format(netcfg_src)) # Hostname with FQDN (if exist) -- cgit v1.2.3