← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1852100] [NEW] Cloud-init fails if metadata local-hostname is null

 

Public bug reported:

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/__init__.py", line 447, in find_source
    if s.get_data():
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 132, in get_data
    self._get_standardized_metadata())
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 110, in _get_standardized_metadata
    'local-hostname': self.get_hostname(),
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 317, in get_hostname
    if util.is_ipv4(lhost):
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 544, in is_ipv4
    toks = instr.split('.')

Tested on CentOS 7.7, cloud-init 18.5.

** Affects: cloud-init
     Importance: Undecided
     Assignee: Mark Goddard (mgoddard)
         Status: New

** Changed in: cloud-init
     Assignee: (unassigned) => Mark Goddard (mgoddard)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1852100

Title:
  Cloud-init fails if metadata local-hostname is null

Status in cloud-init:
  New

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/__init__.py", line 447, in find_source
      if s.get_data():
    File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 132, in get_data
      self._get_standardized_metadata())
    File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 110, in _get_standardized_metadata
      'local-hostname': self.get_hostname(),
    File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 317, in get_hostname
      if util.is_ipv4(lhost):
    File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 544, in is_ipv4
      toks = instr.split('.')

  Tested on CentOS 7.7, cloud-init 18.5.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1852100/+subscriptions


Follow ups