swiftclient object with beginning /

Bug #1412425 reported by Christopher Bartz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
High
Pradeep Kumar Singh

Bug Description

Dear all,

I have observed an inconsistent behaviour while using the python swiftclient (2.3.1) . It is possible to upload a file with a beginning slash:

    swift upload test /tmp/test

This will create a file called tmp/test in the container tmp. But,

   swift download test /tmp/test

will try to download a file /tmp/test, which does not exist.

Revision history for this message
clayg (clay-gerrard) wrote :

Which pre-existing behavior do you think we could change?

The filename is listed with from `swift list` as "tmp/test"

I'm not sure how much consistency we could really apply here, I don't think it'd be reasonable for download to save the file back into /tmp/test on the filesystem, unless maybe `swift download test tmp/test -o /tmp/test` was all you were looking for?

I think it's important to note that it *is* possible to upload file into swift as `/account/container//tmp/test` if not straight forward with swiftclient...

Revision history for this message
Christopher Bartz (bartz) wrote :

Hello clayg,

sorry, it's true, that it would not make sense to strip the beginning / from the filename when downloading, as it could be part of the objectname.
But it seems that the output of the upload command does no longer return the objectname but the filename which has been uploaded.

I observed that an automatic script broke when upgrading swiftclient from 2.1.0 to 2.3.1 . The reason lies in the output of the swift command when uploading a file.

# swift --version
swift 2.1.0
# swift upload atest /tmp/tmp.Bk3QMVbivC
tmp/tmp.Bk3QMVbivC

# swift --version
swift 2.3.1
# swift upload atest /tmp/tmp.HPCvgbCAQj
/tmp/tmp.HPCvgbCAQj

The automatic script retrieved the output, and tried to download the file, which did not work with swiftclient 2.3.1, because the client outputs the filename and not the object name on the server.

Revision history for this message
clayg (clay-gerrard) wrote :

OH! Well that's annoying - sorry :\

Thanks for the bug report, I think we should go back to the old behavior of printing the object name that was uploaded instead of file on disk that was uploaded. In many cases they may be the same, but when they're different much more useful to report the translated name.

Changed in swift:
importance: Undecided → High
Revision history for this message
clayg (clay-gerrard) wrote :

looks like the obj name is fixed after it's already stuffed in the response dict

Changed in swift:
status: New → Confirmed
tags: added: low-hanging-fruit
Parantap (parantap)
Changed in swift:
assignee: nobody → Parantap (parantap)
Revision history for this message
Parantap (parantap) wrote :
Revision history for this message
Pradeep Kumar Singh (pradeep-singh-u) wrote :

Hi Parantap,

Are you working on the issue?

Revision history for this message
Sandeep Bisht (bishtsanddev) wrote : Re: [Bug 1412425] Re: swiftclient object with beginning /

No.

On Tue, May 19, 2015 at 2:57 PM, pradeep kumar singh <
<email address hidden>> wrote:

> Hi Parantap,
>
> Are you working on the issue?
>
> --
> You received this bug notification because you are subscribed to
> OpenStack Object Storage (swift).
> Matching subscriptions: Sandeep Bisht
> https://bugs.launchpad.net/bugs/1412425
>
> Title:
> swiftclient object with beginning /
>
> Status in OpenStack Object Storage (Swift):
> Confirmed
>
> Bug description:
> Dear all,
>
> I have observed an inconsistent behaviour while using the python
> swiftclient (2.3.1) . It is possible to upload a file with a beginning
> slash:
>
> swift upload test /tmp/test
>
> This will create a file called tmp/test in the container tmp. But,
>
> swift download test /tmp/test
>
> will try to download a file /tmp/test, which does not exist.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/swift/+bug/1412425/+subscriptions
>

Changed in swift:
assignee: Parantap (parantap) → pradeep kumar singh (pradeep-singh-u)
Revision history for this message
Pradeep Kumar Singh (pradeep-singh-u) wrote :
Changed in swift:
status: Confirmed → In Progress
affects: swift → python-swiftclient
Changed in python-swiftclient:
status: In Progress → Fix Committed
Changed in python-swiftclient:
milestone: none → 2.5.0
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.