cloud-init fails when encountering unexpected header

Bug #1065116 reported by Yoni Yalovitsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Unassigned

Bug Description

When the cloud-config includes a header other than ('content', 'filename', 'type', 'launch-index') the bootstrap fails with:
    File "/usr/lib/python2.7/dist-packages/cloudinit/UserDataHandler.py", line 127, in explode_cc_archive

      msg.add_header(header, ent['header'])

  KeyError: 'header'

I assume that the bug stems from the literal key in /cloudinit/user_data.py:227 and suggest:
- msg.add_header(header, ent['header'])
+ msg.add_header(header, ent[header])

Related branches

Changed in cloud-init:
assignee: nobody → Avishai Ish-Shalom (avishai-ish-shalom)
Changed in cloud-init:
status: New → Confirmed
Revision history for this message
Scott Moser (smoser) wrote :

Can you give a better example of the problem?
Cloud-config snippet that demonstrates the issue?

Revision history for this message
Yoni Yalovitsky (yoni-o) wrote :

Below is a (sanitized) copy of the error-causing cloud-config:

#cloud-config-archive
- type: text/cloud-config
  file: Staging-US-Database-cloud-config.yml
  content: |
    #cloud-config
    apt_update: True

    packages:
      - ruby1.9.1
      - ruby1.9.1-dev
      - libruby1.9.1

    disable_root: False
    ssh_pwauth: False
    manage_etc_hosts: False

    output:
      all: "| tee -a /var/log/cloud-init-output.log"
- type: text/x-shellscript
  file: Staging-US-Database-user-data.sh
  content: |
    #! /bin/bash
    #
    prepare_and_run_chef

Revision history for this message
Scott Moser (smoser) wrote :

fixed in trunk at 693.

Changed in cloud-init:
importance: Undecided → High
status: Confirmed → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
assignee: Avishai Ish-Shalom (avishai-ish-shalom) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.