Skip to content

Commit

Permalink
fix(backend): 修复sync bkrepo的url问题 #7744
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud committed Nov 4, 2024
1 parent e842b0a commit 465f30c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dbm-ui/backend/dbm_init/medium/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def sync_from_bkrepo(self, db_type):
print("sync info %s", json.dumps(package_params, indent=4))

data = {"db_type": db_type, "sync_medium_infos": package_sync_params}
http.post(url="apis/packages/sync_medium/", data=data)
http.post(url="/apis/packages/sync_medium/", data=data)

@classmethod
def update_lock(cls, bkrepo_tmp_dir):
Expand Down
3 changes: 2 additions & 1 deletion dbm-ui/backend/dbm_init/medium/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import logging
import os
from typing import Any
from urllib.parse import urljoin

import curlify
import requests
Expand Down Expand Up @@ -59,7 +60,7 @@ def _gen_header_cookie(self, send_file=False):
def _http_request(
self, method, url, headers=None, data=None, verify=False, cert=None, timeout=None, cookies=None, **kwargs
):
url = f"{os.getenv('DBM_SAAS_URL')}{url}"
url = urljoin(os.getenv("DBM_SAAS_URL"), url)
resp = requests.Response()
try:
if method == "GET":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def format_common_cluster_info(self):
CommonValidate._validate_domain_valid(domain_name)
# 在info里,补充每个主从集群的部署信息
info.update(
disaster_tolerance_level=self.ticket_data.get("disaster_tolerance_level"),
city=self.ticket_data.get("city_code"),
city_code=self.ticket_data.get("city_code"),
db_version=self.ticket_data.get("db_version"),
Expand Down

0 comments on commit 465f30c

Please sign in to comment.