Creating a pseudo folder with the same name of one object at the same level would overwrite the object into a folder
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
If you upload a file with same name as one subfolder, the file won't be uploaded. However if you create a new subfolder with the same name of one object, the object will be overwritten.
Say I have a container called test, the contents are:
pseudo-1/ (pseudo folder)
file-1 (actual file)
Now I try to upload a actual file to test with the file name "pseudo-1", the file won't be uploaded.
However, if I try to create a new pseudo folder named "file-1", the original actual file would be overwritten by the newly created pseudo folder.
Upload file code:
api = cloudfiles.
container = api(request)
obj = container.
obj.send(
Create pseudo folder code:
container = api(request)
obj = container.
obj.headers = {'content-
obj.send('')
obj.sync_metadata()
You may have to describe this a bit better. Also, please note that there are no actual folders in Swift. There is the concept of pseudo folders, but that is based on the names of objects.
Swift has accounts at the topmost level, then containers within an account, then a flat list of objects within a container. Imagine this list of objects in a container:
one
one/a
one/a/1/i
two/b/2/ii
This is four objects in a flat list. Pseudo directories are understood as
one/
one/a/
one/a/1/
two/
two/b/
two/b/2/
But these aren't actual objects, they're just pseudo directories based on the names of objects that do exist.