Skip to content

Commit 799e9b0

Browse files
committed
Fix RdsUtils not being found
1 parent fba61e5 commit 799e9b0

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

aws_advanced_python_wrapper/cluster_topology_monitor.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@
2020
from concurrent.futures import ThreadPoolExecutor
2121
from typing import TYPE_CHECKING, Dict, Optional
2222

23+
from aws_advanced_python_wrapper.errors import AwsWrapperError
2324
from aws_advanced_python_wrapper.host_availability import HostAvailability
2425
from aws_advanced_python_wrapper.hostinfo import HostInfo
2526
from aws_advanced_python_wrapper.utils.atomic import AtomicReference
2627
from aws_advanced_python_wrapper.utils.messages import Messages
28+
from aws_advanced_python_wrapper.utils.rds_utils import RdsUtils
29+
from aws_advanced_python_wrapper.utils.storage.storage_service import (
30+
StorageService, Topology)
2731
from aws_advanced_python_wrapper.utils.thread_safe_connection_holder import \
2832
ThreadSafeConnectionHolder
2933
from aws_advanced_python_wrapper.utils.utils import LogUtils
@@ -303,8 +307,8 @@ def _open_any_connection_and_update_topology(self) -> Topology:
303307
self._cluster_id, self._initial_host_info.host)
304308

305309
try:
306-
writer_id = self._topology_utils.get_writer_host_if_connected(
307-
conn, self._plugin_service.driver_dialect)
310+
writer_id = self._topology_utils.get_writer_id_if_connected(
311+
conn, self._plugin_service.driver_dialect)
308312
if writer_id:
309313
self._is_verified_writer_connection = True
310314
writer_verified_by_this_thread = True
@@ -313,9 +317,10 @@ def _open_any_connection_and_update_topology(self) -> Topology:
313317
writer_host_info = self._initial_host_info
314318
self._writer_host_info.set(writer_host_info)
315319
else:
316-
writer_host = self._instance_template.host.replace("?", writer_id)
317-
port = self._instance_template.port \
318-
if self._instance_template.is_port_specified() \
320+
instance_template = self._get_instance_template(writer_id, conn)
321+
writer_host = instance_template.host.replace("?", writer_id)
322+
port = instance_template.port \
323+
if instance_template.is_port_specified() \
319324
else self._initial_host_info.port
320325
writer_host_info = HostInfo(
321326
writer_host,

0 commit comments

Comments
 (0)