summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2021-02-14 19:21:10 +0200
committerzsdc <taras@vyos.io>2021-02-14 19:37:01 +0200
commita3e1b519dfce76c3df612bc5513101246ac281f6 (patch)
tree9705d3069fd32bc019595ee86530d7c5b617c0c4 /cloudinit
parent3b0c82a46e655ff2980957be582220cfba3eb6fc (diff)
downloadvyos-cloud-init-a3e1b519dfce76c3df612bc5513101246ac281f6.tar.gz
vyos-cloud-init-a3e1b519dfce76c3df612bc5513101246ac281f6.zip
network-config: T2403: Fixed missed network-config
The commit ceaa51c3df393d8bcfb8aa58e47d9d2eb7a9efb2 fixed receiving network-config for non-typical, "internal" datasources not addressed to be used normally, but broke this for normal ones. So, this is the third time when this part of the module must be changed to combine both methods: `cloud.datasource.network_config` for normal and `init_stage._find_networking_config()` for internal.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_vyos.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/config/cc_vyos.py b/cloudinit/config/cc_vyos.py
index e472a1cd..338f5507 100644
--- a/cloudinit/config/cc_vyos.py
+++ b/cloudinit/config/cc_vyos.py
@@ -454,8 +454,12 @@ def handle(name, cfg, cloud, log, _args):
vendordata = cloud.datasource.vendordata
logger.debug("Vendor-Data: {}".format(vendordata))
# Network-config
- init_stage = Init()
- (netcfg, netcfg_src) = init_stage._find_networking_config()
+ netcfg = cloud.datasource.network_config
+ if netcfg:
+ netcfg_src = dsname
+ else:
+ init_stage = Init()
+ (netcfg, netcfg_src) = init_stage._find_networking_config()
logger.debug("Network-config: {}".format(netcfg))
logger.debug("Network-config source: {}".format(netcfg_src))
# Hostname with FQDN (if exist)