Bug 1012308 - horizon: upload to swift from cli shows directories
Summary: horizon: upload to swift from cli shows directories
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-horizon
Version: 4.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.0
Assignee: Julie Pichon
QA Contact: Ami Jeain
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-26 09:05 UTC by Dafna Ron
Modified: 2015-02-15 22:02 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-23 15:32:45 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Dafna Ron 2013-09-26 09:05:34 UTC
Description of problem:

there are some differences between how we see files that are uploaded from horizon and files uploaded from the cli.

if I upload a file from horizon I will just see the file name (i.e upload -> select a dir -> select a file)
if I upload a file from cli, if I specify a directory (i.e /tmp) than horizon will show the entire path
if I upload a file from cli without specifying a directory (i.e cd /tmp swift upload <container> <file>) I see just the file.

I think that there should be consistency between horizon and cli.
also, if you use a linux command like scp for example, the original path is not relevant so I do not think that we should be seeing that in swift as well.

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

python-django-horizon-2013.2-0.12b3.el6ost.noarch

How reproducible:

100%

Steps to Reproduce:
1. upload a file from horizon
2. upload a file from cli: swift upload <container> <file>
3. upload a file from cli: swift upload <container> </tmp/file>

Actual results:

in horizon, the file that was given a path will show the directory under the container

Expected results:

we should not show the path 

Additional info:

https://bugs.launchpad.net/horizon/+bug/1231331

Comment 1 Dafna Ron 2013-09-26 09:17:50 UTC
also, if we try to remove the directory from horizon:

Error: You do not have permission to delete object: tmp

while cli will give:

[root@nott-vdsa ~(keystone_admin)]# swift delete dafna tmp
Object 'dafna/tmp' not found
[root@nott-vdsa ~(keystone_admin)]# swift list dafna
tmp/ks-script-uLSgyo.log
[root@nott-vdsa ~(keystone_admin)]#

Comment 2 Julie Pichon 2013-10-23 15:32:45 UTC
IMO, the behaviour is consistent between both:

Via Horizon:
1. Upload file "test" with name "test" -> a test file is shown at the top level
2. Upload file test with name "tmp/test" -> a test file is created within a "tmp" directory (actually pseudo-folder)

Via Swift CLI:
1. swift upload test -> a test file is shown at the top level
2. swift upload tmp/test -> the test file and tmp directory (actually pseudo-folder) are uploaded

This is the way Swift works: http://docs.openstack.org/api/openstack-object-storage/1.0/content/folders-directories.html . To navigate the pseudo-folders you'd then use the 'delimiter' option together with 'list':

$ swift list test
test/test_within_test
tmp/test_within_test
tmp/tmp_file

$ swift list test -d /
test/
tmp/

This is the spec that Horizon follows.

I think it would be better to file a bug about the error message discrepancy mentioned in comment 1 separately, if you don't mind filing another bug. I think Horizon could do better and ideally explain why it can't be deleted. Thanks!


Note You need to log in before you can comment on or make changes to this bug.