Skip to content

Commit

Permalink
fix: fix_add_spider_routing TencentBlueKing#7621
Browse files Browse the repository at this point in the history
  • Loading branch information
xfan0805 authored and zhangzhw8 committed Oct 28, 2024
1 parent 6148f9f commit aec3d73
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ def _drop_user(self, spider_ip: str, spider_port: int, cluster: Cluster):
res = DRSApi.rpc(
{
"addresses": [f"{spider_ip}{IP_PORT_DIVIDER}{spider_port}"],
"cmds": [f"DROP USER if exists '{TDBCTL_USER}'@'{primary_host}'"],
"cmds": [f"DROP USER '{TDBCTL_USER}'@'{primary_host}'"],
"force": False,
"bk_cloud_id": cluster.bk_cloud_id,
}
)
if res[0]["error_msg"]:
self.log_error(f"drop user failed:[{res[0]['error_msg']}]")
return False
self.log_warning(f"drop user failed:[{res[0]['error_msg']}]")
return True

def _read_ctl_pass(self, ctl_master, bk_cloud_id):
Expand Down Expand Up @@ -182,8 +181,7 @@ def _add_system_user(
admin_port = cluster.proxyinstance_set.first().admin_port

for spider_ip in add_spiders:
if not self._drop_user(spider_ip=spider_ip["ip"], spider_port=spider_port, cluster=cluster):
return False
self._drop_user(spider_ip=spider_ip["ip"], spider_port=spider_port, cluster=cluster)

content = {
"bk_cloud_id": cluster.bk_cloud_id,
Expand Down

0 comments on commit aec3d73

Please sign in to comment.