os-refresh-config TypeError: 'unicode' object does not support item assignment

Bug #1421285 reported by Ben Nemec
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Critical
Steve Baker
os-apply-config
Triaged
Medium
Unassigned
tripleo
Fix Released
Critical
Unassigned

Bug Description

In CI right now we're seeing that overcloud os-refresh-config runs are all failing with the subject error.

Full traceback:
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: ++ os-apply-config --key block-device-mapping.ephemeral0 --type raw --key-default ''
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: Traceback (most recent call last):
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: File "/usr/local/bin/os-apply-config", line 11, in <module>
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: sys.exit(main())
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/os_apply_config/apply_config.py", line 327, in main
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: opts.fallback_metadata)
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/os_apply_config/apply_config.py", line 84, in print_key
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: config = collect_config.collect_config(config_path, fallback_metadata)
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/os_apply_config/collect_config.py", line 69, in collect_config
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: return merge_configs(parse_configs(read_configs(os_config_files)))
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/os_apply_config/collect_config.py", line 61, in merge_configs
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: final_conf = _deep_merge_dict(final_conf, conf)
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/os_apply_config/collect_config.py", line 53, in _deep_merge_dict
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: new_dict[k] = copy.deepcopy(v)
Feb 12 07:13:39 ov-ob2o3kulh3h-0-dixer22ushah-controller-drjv43w2yw2x os-collect-config[787]: TypeError: 'unicode' object does not support item assignment

Revision history for this message
Ben Nemec (bnemec) wrote :
Revision history for this message
Steven Hardy (shardy) wrote :

Apparently reverting https://github.com/openstack/heat/commit/1e82f2c2c35155e0c441e2c57a7b7c9cca208fce fixes this, so marking as critical heat bug until we understand why.

Changed in heat:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Steven Hardy (shardy)
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Ah, an empty config for a StructuredDeployment resource will be {}, not ''

SoftwareDeployment needs a method

  def empty_config(self):
    return ''

which StructuredDeployment overrides to return {}

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

lets just revert it in heat too

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/155492

Changed in heat:
assignee: Steven Hardy (shardy) → Steve Baker (steve-stevebaker)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/155492
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=b487a9773f964643c87d560e0ab61812e7732b68
Submitter: Jenkins
Branch: master

commit b487a9773f964643c87d560e0ab61812e7732b68
Author: Steve Baker <email address hidden>
Date: Thu Feb 12 21:30:13 2015 +0000

    Revert "Allow empty 'config' for software deployment"

    This can be proposed again once it avoids causing:
    Closes-Bug: #1421285

    This reverts commit 1e82f2c2c35155e0c441e2c57a7b7c9cca208fce.

    Change-Id: Ie13a662d1325109cb05a92a3939672937330e4f3

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Adding an os-apply-config task. We can do a bit more validation and not just dump a TypeError.

Changed in os-apply-config:
status: New → Triaged
importance: Undecided → Medium
Derek Higgins (derekh)
Changed in tripleo:
status: Triaged → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-3 → 2015.1.0
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.