Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Fixes #14 : list_directory always return empty list #15

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docker_registry/drivers/swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,18 @@ def list_directory(self, path=None):
path += '/'
_, directory = self._swift_connection.get_container(
container=self._swift_container,
path=path)
prefix=path,
delimiter='/')
if not directory:
raise
for inode in directory:
# trim extra trailing slashes
if inode['name'].endswith('/'):
inode['name'] = inode['name'][:-1]
if inode['subdir'].endswith('/'):
inode['subdir'] = inode['subdir'][:-1]
if self._root_path != '/':
inode['name'] = inode['name'].replace(
inode['subdir'] = inode['subdir'].replace(
self._init_path() + '/', '', 1)
yield inode['name']
yield inode['subdir']
except Exception:
raise exceptions.FileNotFoundError('%s is not there' % path)

Expand Down