cloud-init crashes on blank lines in include files

Bug #923043 reported by Ken Rimey on 2012-01-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Low
Scott Moser

Bug Description

The documentation says the format is one URL per line, but comments are also allowed.
If comments are allowed, blank lines should be allowed too.

A traceback follows. This is with cloud-init 0.6.1 on EC2 in ubuntu/images/ebs/ubuntu-oneiric-11.10-amd64-server-20120108 (ami-6fa27506).

----
cloud-init start running: Sat, 28 Jan 2012 12:42:04 +0000. up 11.87 seconds

Traceback (most recent call last):

  File "/usr/bin/cloud-init", line 192, in <module>

    main()

  File "/usr/bin/cloud-init", line 138, in main

    cloud.update_cache()

  File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 245, in update_cache

    self.store_userdata()

  File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 251, in store_userdata

    self.datasource.get_userdata(), 0600)

  File "/usr/lib/python2.7/dist-packages/cloudinit/DataSource.py", line 52, in get_userdata

    self.userdata = ud.preprocess_userdata(self.userdata_raw)

  File "/usr/lib/python2.7/dist-packages/cloudinit/UserDataHandler.py", line 190, in preprocess_userdata

    process_includes(email.message_from_string(decomp_str(data)),parts)

  File "/usr/lib/python2.7/dist-packages/cloudinit/UserDataHandler.py", line 142, in process_includes

    do_include(payload,parts)

  File "/usr/lib/python2.7/dist-packages/cloudinit/UserDataHandler.py", line 78, in do_include

    content = urllib.urlopen(line).read()

  File "/usr/lib/python2.7/urllib.py", line 84, in urlopen

    return opener.open(url)

  File "/usr/lib/python2.7/urllib.py", line 205, in open

    return getattr(self, name)(url)

  File "/usr/lib/python2.7/urllib.py", line 461, in open_file

    return self.open_local_file(url)

  File "/usr/lib/python2.7/urllib.py", line 475, in open_local_file

    raise IOError(e.errno, e.strerror, e.filename)

IOError: [Errno 2] No such file or directory: ''

Related branches

Scott Moser (smoser) wrote :

should be fixed in revno 512.

Changed in cloud-init:
assignee: nobody → Scott Moser (smoser)
importance: Undecided → Low
status: New → In Progress
status: In Progress → Fix Committed
Scott Moser (smoser) on 2012-04-11
Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers