Bug 1126942

Summary: Swift pseudo-folder cannot be interacted with after creation
Product: [Community] RDO Reporter: Kodiak Firesmith <kfiresmith>
Component: python-swiftclientAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED CURRENTRELEASE QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: derekh, yeylon, zaitcev
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: python-swiftclient-2.1.0-3.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-30 23:08:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Pete Zaitcev's hard work none

Description Kodiak Firesmith 2014-08-05 16:04:40 UTC
Created attachment 924253 [details]
Pete Zaitcev's hard work

Description of problem:
Cannot delete, download, or access a Swift "Pseudo-folder" after creation.  Attempting any of these results in a traceback.


Version-Release number of selected component (if applicable):
Icehouse RDO

How reproducible:
Create a pseudo-folder in Horizon, then try to do *anything* with it.

Steps to Reproduce:
1. Create pseudo folder in Horizon UI
2. Click on pseudo-foler link or attempt to download it using Swift CLI
3. Experience the traceback

Actual results:
(http://paste.openstack.org/show/90034/)
# swift download test_container 
first-object [auth 1.588s, headers 2.390s, total 2.390s, 0.004 MB/s]
test-300M.file [auth 1.310s, headers 1.356s, total 20.171s, 15.905 MB/s]
test-200M.file [auth 1.402s, headers 1.447s, total 39.217s, 5.416 MB/s]
test2.file [auth 1.666s, headers 2.382s, total 73.224s, 1.431 MB/s]
test1.file [auth 0.801s, headers 0.848s, total 93.741s, 11.018 MB/s]
test-400M.file [auth 1.663s, headers 2.379s, total 104.722s, 3.974 MB/s]
test5g.file [auth 1.516s, headers 1.560s, total 244.565s, 22.089 MB/s]
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/swiftclient/multithreading.py", line 74, in run
    result = self.func(item, *self.args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/swiftclient/shell.py", line 403, in _download_object
    fp = open(path, 'wb')
IOError: [Errno 21] Is a directory: 'first-pseudo-folder/'

Expected results:
Download pseudo-folder


Additional info: Mr. Pete Zaitcev (of Redhat) has already produced a patch for this issue based upon some prior conversation on #openstack-swift IRC:
http://people.redhat.com/zaitcev/tmp/x.diff

Comment 1 Pete Zaitcev 2014-08-05 21:11:19 UTC
The practice of creating objects with a trailing slash is documented in
OpenStack Object Storage API v1 Reference, section 1. "Object Storage
API concepts and features", clause "Pseudo-hierarchical folders and
directories".

http://docs.openstack.org/api/openstack-object-storage/1.0/content/pseudo-hierarchical-folders-directories.html

Comment 2 Pete Zaitcev 2014-09-09 18:52:48 UTC
The fix is merged upstream on August 17 as commit
3d56b65c898d7997819f2627a2fb722bd0c33b69.
Additionally, a fix-up corrected tests as commit
309437bb5255a2205337fb951fc3c6836cfdaabf.

There was no release since 2.2.0 in July. If we go cherry-pick
for this, I recommend we only pick the main commit for simplicity.