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

fixing url filename in config install #10423

Merged
merged 2 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions conans/client/conf/config_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

from datetime import datetime
from dateutil.tz import gettz

from contextlib import contextmanager
from six.moves.urllib.parse import urlparse
from six.moves.urllib.parse import urlparse, urlsplit

from conans import load
from conans.client import tools
Expand Down Expand Up @@ -147,7 +146,9 @@ def _process_folder(config, folder, cache, output):
def _process_download(config, cache, output, requester):
with tmp_config_install_folder(cache) as tmp_folder:
output.info("Trying to download %s" % _hide_password(config.uri))
zippath = os.path.join(tmp_folder, os.path.basename(config.uri))
path = urlsplit(config.uri).path
filename = os.path.basename(path)
zippath = os.path.join(tmp_folder, filename)
try:
downloader = FileDownloader(requester=requester, output=output, verify=config.verify_ssl,
config_retry=None, config_retry_wait=None)
Expand Down
12 changes: 12 additions & 0 deletions conans/test/functional/command/config_install_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,18 @@ def my_download(obj, url, file_path, **kwargs): # @UnusedVariable
self.client.run("config install http://myfakeurl.com/myconf.zip %s" % origin)
self._check("url, http://myfakeurl.com/myconf.zip, True, None")

def test_install_url_query(self):
""" should install from a URL
"""

def my_download(obj, url, file_path, **kwargs): # @UnusedVariable
self._create_zip(file_path)

with patch.object(FileDownloader, 'download', new=my_download):
# repeat the process to check it works with ?args
self.client.run("config install http://myfakeurl.com/myconf.zip?sha=1")
self._check("url, http://myfakeurl.com/myconf.zip?sha=1, True, None")

def test_install_change_only_verify_ssl(self):
def my_download(obj, url, file_path, **kwargs): # @UnusedVariable
self._create_zip(file_path)
Expand Down