From 74f0f17ad86ee04975501d1949c5a3d94f54b463 Mon Sep 17 00:00:00 2001 From: David James Date: Tue, 30 Nov 2010 13:56:52 -0800 Subject: [PATCH] Use regular string ops, instead of urlparse.urljoin. urlparse.urljoin('scheme:foo/bar/', 'baz') == 'baz', so it doesn't work the way I expected. Instead, let's use regular string joins. BUG=chromium-os:5311 TEST=Ran buildbot in test mode. Change-Id: Iea4205573db602e0cc20af24a77d255d17e79221 Review URL: http://codereview.chromium.org/5357012 --- prebuilt.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/prebuilt.py b/prebuilt.py index 4baf95dab6..607397ee8d 100755 --- a/prebuilt.py +++ b/prebuilt.py @@ -11,7 +11,6 @@ import re import sys import tempfile import time -import urlparse from chromite.lib import cros_build_lib from chromite.lib.binpkg import (GrabLocalPackageIndex, GrabRemotePackageIndex, @@ -317,7 +316,7 @@ def GenerateUploadDict(base_local_path, base_remote_path, pkgs): suffix = pkg['CPV'] + '.tbz2' local_path = os.path.join(base_local_path, suffix) assert os.path.exists(local_path) - remote_path = urlparse.urljoin(base_remote_path, suffix) + remote_path = '%s/%s' % (base_remote_path.rstrip('/'), suffix) upload_files[local_path] = remote_path return upload_files @@ -415,7 +414,7 @@ def UploadPrebuilt(build_path, upload_location, version, binhost_base_url, git_file = os.path.join(build_path, DetermineMakeConfFile(board)) binhost_conf = os.path.join(build_path, _BINHOST_CONF_DIR, 'target', '%s.conf' % board) - remote_location = urlparse.urljoin(upload_location, url_suffix) + remote_location = '%s/%s' % (upload_location.rstrip('/'), url_suffix) # Process Packages file, removing duplicates and filtered packages. pkg_index = GrabLocalPackageIndex(package_path) @@ -429,7 +428,7 @@ def UploadPrebuilt(build_path, upload_location, version, binhost_base_url, if upload_location.startswith('gs://'): # Build list of files to upload. upload_files = GenerateUploadDict(package_path, remote_location, uploads) - remote_file = urlparse.urljoin(remote_location, 'Packages') + remote_file = '%s/Packages' % remote_location.rstrip('/') upload_files[tmp_packages_file.name] = remote_file print 'Uploading %s' % package_string