Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 4e6a263

Browse files
committed
Fix list_directory in dumb driver.
1 parent 808c04c commit 4e6a263

File tree

1 file changed

+4
-1
lines changed
  • depends/docker-registry-core/docker_registry/drivers

1 file changed

+4
-1
lines changed

depends/docker-registry-core/docker_registry/drivers/dumb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ def list_directory(self, path=None):
122122
ls = []
123123
for k in self._storage.keys():
124124
if (not k == path) and k.startswith(path or ''):
125-
ls.append(k)
125+
prefix = '/'
126+
if not k.startswith('/'):
127+
prefix = ''
128+
ls.append(prefix + "/".join(k.lstrip("/").split("/")[0:2]))
126129

127130
if not len(ls):
128131
raise exceptions.FileNotFoundError('%s is not there' % path)

0 commit comments

Comments
 (0)