← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~powersj/cloud-init:fix-arch-dns into cloud-init:master

 

Joshua Powers has proposed merging ~powersj/cloud-init:fix-arch-dns into cloud-init:master.

Commit message:
archlinux: Fix empty dns on writing network config

cloud-init fails when dns-nameservers is None.

LP: #1663045

Requested reviews:
  Server Team CI bot (server-team-bot): continuous-integration
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1663045 in cloud-init: "Arch distro fails to write network config with empty dns-nameservers"
  https://bugs.launchpad.net/cloud-init/+bug/1663045

For more details, see:
https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/327914
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:fix-arch-dns into cloud-init:master.
diff --git a/cloudinit/distros/arch.py b/cloudinit/distros/arch.py
index 75d4620..55078d1 100644
--- a/cloudinit/distros/arch.py
+++ b/cloudinit/distros/arch.py
@@ -64,7 +64,8 @@ class Distro(distros.Distro):
                 'Address': "('%s/%s')" % (info.get('address'),
                                           info.get('netmask')),
                 'Gateway': info.get('gateway'),
-                'DNS': str(tuple(info.get('dns-nameservers'))).replace(',', '')
+                'DNS': str(tuple(info.get('dns-nameservers', ()))).replace(',',
+                                                                           '')
             }
             util.write_file(net_fn, convert_netctl(net_cfg))
             if info.get('auto'):