diff --git a/src/pelicanfs/core.py b/src/pelicanfs/core.py index 3948f64..cfa4a32 100644 --- a/src/pelicanfs/core.py +++ b/src/pelicanfs/core.py @@ -390,6 +390,11 @@ async def _isdir(self, path): async def _find(self, path, maxdepth=None, withdirs=False, **kwargs): results = await self.httpFileSystem._find(path, maxdepth, withdirs, **kwargs) return self._remove_host_from_paths(results) + + @_dirlist_dec + async def _info(self, path, **kwargs): + results = await self.httpFileSystem._info(path, **kwargs) + return self._remove_host_from_paths(results) async def _isfile(self, path): return not await self._isdir(path) @@ -467,12 +472,6 @@ async def _glob(self, path, maxdepth=None, **kwargs): else: return list(out) - - @_dirlist_dec - async def _info(self, path, **kwargs): - results = await self.httpFileSystem._info(path, **kwargs) - return self._remove_host_from_paths(results) - @_dirlist_dec async def _du(self, path, total=True, maxdepth=None, **kwargs): return await self.httpFileSystem._du(path, total, maxdepth, **kwargs) @@ -627,7 +626,6 @@ async def _get_file(self, rpath, lpath, **kwargs): async def _get(self, rpath, lpath, **kwargs): results = await self.httpFileSystem._get(rpath, lpath, **kwargs) return self._remove_host_from_paths(results) - @_cache_multi_dec async def _cat(self, path, recursive=False, on_error="raise", batch_size=None, **kwargs): diff --git a/test/test_director.py b/test/test_director.py index f0beaf4..fb2c1f7 100644 --- a/test/test_director.py +++ b/test/test_director.py @@ -155,6 +155,7 @@ def test_info(httpserver: HTTPServer, get_client): "X-Pelican-Namespace": "namespace=/foo" }, ) + httpserver.expect_oneshot_request("/foo/bar", method="HEAD").respond_with_data(listing_response) httpserver.expect_request("/foo/bar", method="GET").respond_with_data(listing_response) pelfs = pelicanfs.core.PelicanFileSystem( httpserver.url_for("/"),