Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webdav.py Default.stat() module: Match error when finding size of current file #5308

Closed
cfenell opened this issue Mar 2, 2022 · 0 comments
Closed

Comments

@cfenell
Copy link
Contributor

cfenell commented Mar 2, 2022

Motivation

The stat method tries to find the reported size of the current file in the list returned by the PROPFIND request in this way:

        parser.feed(result.text)
        for file_name in parser.sizes:
            if '%s%s' % (self.server, file_name) == path:
                dict_['size'] = parser.sizes[file_name]
        parser.close()
        return dict_

However, for me self_server ends with PREFIX and file_name starts with PREFIX, so the match will always fail unless one PREFIX is stripped. As an example this should match:
if "https://store1.eiscat3d.se:2880/home/tester/home/tester/root.EISCAT/dd/f0/file2.bin.rucio.upload"== "https://store1.eiscat3d.se:2880/home/tester/root.EISCAT/dd/f0/file2.bin.rucio.upload"

Modification

self.server should probably be only https://hostname:port without the /prefix/ part.

@akselaase akselaase self-assigned this Jul 4, 2022
akselaase added a commit to akselaase/rucio that referenced this issue Jul 6, 2022
…cio#5700, fix rucio#5308

As described in rucio#5700, the parser for the WebDAV server responses had
issues with namespace handling. This caused Rucio to misinterpret
responses from for instance the Apache DAV module. Changing the
implementation to use Python's xml.etree.ElementTree fixes this issue.

This PR also includes a fix for rucio#5308, in which Rucio doesn't properly
handle DAV servers with path prefixes.
@bari12 bari12 closed this as completed in 22a5662 Jul 29, 2022
@bari12 bari12 added this to the 1.30.0 "The Donkeynator" milestone Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants