manager_client: server_add with start=false shouldn't call driver_connect

If the server is not started there is not point
in starting the driver, it would fail because there
are no nodes to connect to. On the other hand, we
should connect the driver in server_start()
if it's not connected yet.
This commit is contained in:
Petr Gusev
2024-02-22 15:42:05 +04:00
parent 3f6cf38dd5
commit 99ddffac32

View File

@@ -189,7 +189,10 @@ class ManagerClient():
data = {"expected_error": expected_error}
await self.client.put_json(f"/cluster/server/{server_id}/start", data)
await self.server_sees_others(server_id, wait_others, interval = wait_interval)
self._driver_update()
if self.cql:
self._driver_update()
else:
await self.driver_connect()
async def server_restart(self, server_id: ServerNum, wait_others: int = 0,
wait_interval: float = 45) -> None:
@@ -299,7 +302,7 @@ class ManagerClient():
logger.debug("ManagerClient added %s", s_info)
if self.cql:
self._driver_update()
else:
elif start:
await self.driver_connect()
return s_info
@@ -339,7 +342,7 @@ class ManagerClient():
logger.debug("ManagerClient added %s", s_infos)
if self.cql:
self._driver_update()
else:
elif start:
await self.driver_connect()
return s_infos