util: Strip file:// from local urls

Make sure that the function returns a path even for local files
specified by file:// urls.

JIRA: RHELCMP-5340
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2021-05-06 12:37:01 +02:00
parent c27bfe0c59
commit 7fe32ae758
2 changed files with 7 additions and 0 deletions

View file

@ -1046,6 +1046,8 @@ def as_local_file(url):
yield local_filename
finally:
os.remove(local_filename)
elif url.startswith("file://"):
yield url[7:]
else:
# Not a remote url, return unchanged.
yield url