cloud-init fails when encountering unexpected header

Bug #1065116 reported by Yoni Yalovitsky
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

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/", 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/ 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:

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

      - ruby1.9.1
      - ruby1.9.1-dev
      - libruby1.9.1

    disable_root: False
    ssh_pwauth: False
    manage_etc_hosts: False

      all: "| tee -a /var/log/cloud-init-output.log"
- type: text/x-shellscript
  content: |
    #! /bin/bash

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.