headers with a value of None does not work anymore

Bug #1256441 reported by Chmouel Boudjnah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Chmouel Boudjnah
python-swiftclient
Fix Released
Medium
Chmouel Boudjnah

Bug Description

Before commit 7d88d14d (https://github.com/openstack/python-swiftclient/commit/7d88d14def2541227fb4d3f96016a51b0bafa36b) swifclient would accept value of the type None :

{'Headers': None}

and would just not do anything on those None, now it crash when there is a value of None :

2013-11-29 11:25:43.911 ERROR heat.engine.resource [-] CREATE : SwiftContainer "SwiftContainer"
2013-11-29 11:25:43.911 TRACE heat.engine.resource Traceback (most recent call last):
2013-11-29 11:25:43.911 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 373, in _do_action
2013-11-29 11:25:43.911 TRACE heat.engine.resource handle_data = handle()
2013-11-29 11:25:43.911 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/swift.py", line 101, in handle_create
2013-11-29 11:25:43.911 TRACE heat.engine.resource self.swift().put_container(container, headers)
2013-11-29 11:25:43.911 TRACE heat.engine.resource File "/opt/stack/python-swiftclient/swiftclient/client.py", line 1185, in put_container
2013-11-29 11:25:43.911 TRACE heat.engine.resource response_dict=response_dict)
2013-11-29 11:25:43.911 TRACE heat.engine.resource File "/opt/stack/python-swiftclient/swiftclient/client.py", line 1113, in _retry
2013-11-29 11:25:43.911 TRACE heat.engine.resource rv = func(self.url, self.token, *args, **kwargs)
2013-11-29 11:25:43.911 TRACE heat.engine.resource File "/opt/stack/python-swiftclient/swiftclient/client.py", line 617, in put_container
2013-11-29 11:25:43.911 TRACE heat.engine.resource conn.request(method, path, '', headers)
2013-11-29 11:25:43.911 TRACE heat.engine.resource File "/opt/stack/python-swiftclient/swiftclient/client.py", line 167, in request_escaped
2013-11-29 11:25:43.911 TRACE heat.engine.resource validate_headers(headers)
2013-11-29 11:25:43.911 TRACE heat.engine.resource File "/opt/stack/python-swiftclient/swiftclient/client.py", line 102, in validate_headers
2013-11-29 11:25:43.911 TRACE heat.engine.resource if '\n' in value:
2013-11-29 11:25:43.911 TRACE heat.engine.resource TypeError: argument of type 'NoneType' is not iterable

Changed in python-swiftclient:
assignee: nobody → Chmouel Boudjnah (chmouel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-swiftclient (master)

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

Changed in python-swiftclient:
status: New → In Progress
Changed in python-swiftclient:
importance: Undecided → Medium
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

We probably don't want to store in heat headers as 'None'

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

Reviewed: https://review.openstack.org/59241
Committed: http://github.com/openstack/python-swiftclient/commit/983988093f3848671cb27b3c1956e4ca62087dff
Submitter: Jenkins
Branch: master

commit 983988093f3848671cb27b3c1956e4ca62087dff
Author: Chmouel Boudjnah <email address hidden>
Date: Fri Nov 29 22:59:27 2013 +0100

    Don't crash when header is value of None

    Before commit 7d88d14d (http://git.io/hhJWdQ) swifclient used to accept
    header value with the type None :

    {'Headers': None}

    It would just be happy with it with those None headers and not process
    them, reinstate the old behavior.

    Closes-Bug: 1256441
    Change-Id: Ic7f80c38ef2ce9ef1687ed0d6d65521f2e754905

Changed in python-swiftclient:
status: In Progress → Fix Committed
Changed in heat:
status: New → Fix Committed
assignee: nobody → Chmouel Boudjnah (chmouel)
Thierry Carrez (ttx)
Changed in heat:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-2 → 2014.1
Changed in python-swiftclient:
status: Fix Committed → Fix Released
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.