summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_vyos.py
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2023-01-26 17:57:45 +0200
committerzsdc <taras@vyos.io>2023-01-26 17:57:45 +0200
commitb3812dff44916393c74cba2f2b3e68990d3912df (patch)
tree84e421453a3f2783a27f971cfb52f02a404ed1d1 /cloudinit/config/cc_vyos.py
parentd385e3655e9eed77397136f5e27325a93719332d (diff)
downloadvyos-cloud-init-b3812dff44916393c74cba2f2b3e68990d3912df.tar.gz
vyos-cloud-init-b3812dff44916393c74cba2f2b3e68990d3912df.zip
network-config: T4954: Fixed DNS settings
This commit fixes setting DNS configuration if it was presented as a string instead array of strings.
Diffstat (limited to 'cloudinit/config/cc_vyos.py')
-rw-r--r--cloudinit/config/cc_vyos.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/config/cc_vyos.py b/cloudinit/config/cc_vyos.py
index de60269e..d046cf21 100644
--- a/cloudinit/config/cc_vyos.py
+++ b/cloudinit/config/cc_vyos.py
@@ -438,6 +438,10 @@ def set_config_interfaces_v1(config, iface_config: dict):
# configure nameservers
if iface_config['type'] == 'nameserver':
+ # convert a string to list with a single item if necessary
+ if isinstance(iface_config['address'], str):
+ iface_config['address'] = [iface_config['address']]
+
for item in iface_config['address']:
set_name_server(config, item)