swift cli does not support ':' in metadata values

Bug #930872 reported by Doug Weimer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Doug Weimer

Bug Description

The swift cli does not set a maxsplit value when parsing through the metadata options. All characters after the first ':' in a metadata value are ignored.

For example:

swift post -m 'web-listings-css: https://example.com/fancy.css' documents

Results in the following metadata set on the container:

Meta Web-Listings-Css: https

The code to be changed is in st_post in 3 locations. Here is an example for the container split:

for item in options.meta:
       split_item = item.split(':')
       headers['X-Container-Meta-' + split_item[0]] = \
             len(split_item) > 1 and split_item[1]

item.split(':') should be changed to item.split(':',1)

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

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

Changed in swift:
assignee: nobody → Doug Weimer (dweimer)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/4058
Committed: http://github.com/openstack/swift/commit/48303610a7b954247fb3787b28b1d5fa1a27cb7a
Submitter: Jenkins
Branch: master

commit 48303610a7b954247fb3787b28b1d5fa1a27cb7a
Author: Doug Weimer <email address hidden>
Date: Sun Feb 12 07:16:04 2012 +0000

    Adds support for metadata values with a ':'.

    Changes the item.split(':') in st_post to item.split(':', 1). Fixes bug 930872.
    Adds a helper function named split_metadata to have a common place for parsing
    metadata options. Errors out if the metadata parameters do not contain a :.

    Change-Id: I49bfb4dc8c34410e491cf55ef6e7f9a1466f201f

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.4.7
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.