swift client psudeo-folder upload syntax can't create the container

Bug #1478210 reported by clayg
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
Undecided
James Nzomo

Bug Description

I recently learned about swiftclients pseudo-folder directory-marker support.

It doesn't work with automatic container creation on upload.

vagrant@saio:~$ swift list
vagrant@saio:~$ echo "test" > obj
vagrant@saio:~$ swift upload container/folder obj
Warning: failed to create container 'container/folder': 404 Not Found: <html><h1>Not Found</h1><p>The resource could not be found.<
Object PUT failed: http://saio:8080/v1/AUTH_test/container/folder/obj 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource could not be found.<
vagrant@saio:~$ swift post container
vagrant@saio:~$ swift upload container/folder obj
obj
vagrant@saio:~$ swift list container
folder
folder/obj
vagrant@saio:~$ swift stat container folder
       Account: AUTH_test
     Container: container
        Object: folder
  Content Type: application/octet-stream
Content Length: 0
 Last Modified: Sat, 25 Jul 2015 08:05:19 GMT
          ETag: d41d8cd98f00b204e9800998ecf8427e
 Accept-Ranges: bytes
   X-Timestamp: 1437811518.50778
    X-Trans-Id: tx9cc6c26887cd4bc58c86e-0055b3435b

clayg (clay-gerrard)
summary: - swift client psudeo-directory can't create container
+ swift client psudeo-folder upload syntax can't create the container
James Nzomo (moje)
Changed in python-swiftclient:
assignee: nobody → James Nzomo (moje)
Revision history for this message
James Nzomo (moje) wrote :

Probably only two options here:- force container creation OR reject the arg for the slashes within it.
Most other use cases seem to go with the latter, but implementing the former sorts this and (the currently abandoned) bug 1432734 (https://bugs.launchpad.net/python-swiftclient/+bug/1432734)

James Nzomo (moje)
Changed in python-swiftclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

Reviewed: https://review.openstack.org/263259
Committed: https://git.openstack.org/cgit/openstack/python-swiftclient/commit/?id=2c6f367035bd09978d0fbf8c959d03210e421a9b
Submitter: Jenkins
Branch: master

commit 2c6f367035bd09978d0fbf8c959d03210e421a9b
Author: James Nzomo <email address hidden>
Date: Mon Jan 4 16:09:29 2016 +0300

    Fix upload to pseudo-dir passed by <container> arg

    This fix makes it possible to upload objects to pseudo-folders by
    passing the upload paths via <container> arg regardless of whether the
    container or folder path exist or not.

    Change-Id: I575e58aa12adcf71cdaa70d025a0ea5c63f46903
    Closes-Bug: #1478210
    Partial-Bug: #1432734
    Related-Bug: #1432734

Changed in python-swiftclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-swiftclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/271728

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

Reviewed: https://review.openstack.org/271728
Committed: https://git.openstack.org/cgit/openstack/python-swiftclient/commit/?id=5ed02345d36acf87fc4678e587db713004696124
Submitter: Jenkins
Branch: master

commit 5ed02345d36acf87fc4678e587db713004696124
Author: James Nzomo <email address hidden>
Date: Sun Jan 24 02:43:07 2016 +0300

    Fix segmented upload to pseudo-dir via <container>

    This fix ensures creation and use of the correct default segment
    container when pseudo-folder paths are passed via <container> arg.

    Change-Id: I90356b041dc9dfbd55eb341271975621759476b9
    Closes-Bug: 1532981
    Related-Bug: 1478210

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-swiftclient 3.0.0

This issue was fixed in the openstack/python-swiftclient 3.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/python-swiftclient 3.0.0 release.

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.