Skip to content

Commit

Permalink
Arch: Workaround cloud-init hickup related to key "dns-nameservers"
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Sep 16, 2016
1 parent 14439d4 commit 6f2a670
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions image_bootstrap/distros/arch.py
Expand Up @@ -225,6 +225,17 @@ def _resolve_cloud_init_dependency_argparse(self):
]
self._executor.check_call(cmd, env=self.create_chroot_env())

def _fix_cloud_init_code(self):
"""
Workaround for TypeError: 'NoneType' object is not iterable
"""
cmd = [
COMMAND_CHROOT, self._abs_mountpoint,
'sed', "s:\\.get('dns-nameservers'):\\.get('dns-nameservers', ()):", '-i',
'/usr/lib/python2.7/site-packages/cloudinit/distros/arch.py',
]
self._executor.check_call(cmd, env=self.create_chroot_env())

def install_cloud_init_and_friends(self):
# NOTE: python2-requests is installed to workaround issue #27
# https://github.com/hartwork/image-bootstrap/issues/27
Expand All @@ -235,6 +246,7 @@ def install_cloud_init_and_friends(self):
'python2-requests', 'python2-setuptools',
])
self._resolve_cloud_init_dependency_argparse()
self._fix_cloud_init_code()
self.disable_cloud_init_syslog_fix_perms()
self.install_growpart()

Expand Down

1 comment on commit 6f2a670

@jonhoo
Copy link

@jonhoo jonhoo commented on 6f2a670 Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that https://bugs.launchpad.net/cloud-init/+bug/1663045 has a merge proposal, a fixed version of cloud-init should hopefully appear in upstream and Arch soon.

Please sign in to comment.