This is an automated email from the ASF dual-hosted git repository.

wuzhiguo pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e0b5c42319 AMBARI-25450: Filter auth info in Ubuntu repo (#3523)
e0b5c42319 is described below

commit e0b5c42319858e0aa1f3179588cf354cb9d7297a
Author: Zhiguo Wu <[email protected]>
AuthorDate: Mon Nov 21 23:34:58 2022 +0800

    AMBARI-25450: Filter auth info in Ubuntu repo (#3523)
---
 .../src/main/python/ambari_commons/repo_manager/apt_manager.py       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py 
b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
index 5126533ed2..81ea855a7a 100644
--- a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
+++ b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
@@ -153,7 +153,7 @@ class AptManager(GenericManager):
 
   def transform_baseurl_to_repoid(self, base_url):
     """
-    Transforms the URL looking like proto://localhost/some/long/path to 
localhost_some_long_path
+    Transforms the URL looking like 
proto://login:password@localhost/some/long/path to localhost_some_long_path
 
     :type base_url str
     :rtype str
@@ -163,6 +163,9 @@ class AptManager(GenericManager):
     if url_proto_pos > 0:
       base_url = base_url[url_proto_pos+len(url_proto_mask):]
 
+    if "@" in base_url:
+      base_url = base_url.split("@", 1)[1]
+
     return base_url.replace("/", "_").replace(" ", "_")
 
   def get_available_packages_in_repos(self, repos):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to