Cloud-init fails if metadata local-hostname is null

Bug #1852100 reported by Mark Goddard
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Mark Goddard

Bug Description

If I run cloud-init with a config drive containing a metadata file which has local-hostname set to null, I get the following traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/", line 447, in find_source
    if s.get_data():
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/", line 132, in get_data
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/", line 110, in _get_standardized_metadata
    'local-hostname': self.get_hostname(),
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/", line 317, in get_hostname
    if util.is_ipv4(lhost):
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 544, in is_ipv4
    toks = instr.split('.')

Tested on CentOS 7.7, cloud-init 18.5.

Mark Goddard (mgoddard)
Changed in cloud-init:
assignee: nobody → Mark Goddard (mgoddard)
Mark Goddard (mgoddard)
Changed in cloud-init:
status: New → In Progress
Revision history for this message
Chad Smith (chad.smith) wrote : Fixed in cloud-init version 19.4.

This bug is believed to be fixed in cloud-init in version 19.4. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers