2121from time import perf_counter_ns
2222from typing import TYPE_CHECKING , Dict , Optional
2323
24- from aws_advanced_python_wrapper .errors import AwsWrapperError
2524from aws_advanced_python_wrapper .host_availability import HostAvailability
2625from aws_advanced_python_wrapper .hostinfo import HostInfo , Topology
2726from aws_advanced_python_wrapper .utils import services_container
@@ -345,8 +344,8 @@ def _open_any_connection_and_update_topology(self) -> Topology:
345344 self ._cluster_id , self ._initial_host_info .host )
346345
347346 try :
348- writer_id = self ._topology_utils .get_writer_id_if_connected (
349- conn , self ._plugin_service .driver_dialect )
347+ writer_id = self ._topology_utils .get_writer_host_if_connected (
348+ conn , self ._plugin_service .driver_dialect )
350349 if writer_id :
351350 self ._is_verified_writer_connection = True
352351 writer_verified_by_this_thread = True
@@ -355,10 +354,9 @@ def _open_any_connection_and_update_topology(self) -> Topology:
355354 writer_host_info = self ._initial_host_info
356355 self ._writer_host_info .set (writer_host_info )
357356 else :
358- instance_template = self ._get_instance_template (writer_id , conn )
359- writer_host = instance_template .host .replace ("?" , writer_id )
360- port = instance_template .port \
361- if instance_template .is_port_specified () \
357+ writer_host = self ._instance_template .host .replace ("?" , writer_id )
358+ port = self ._instance_template .port \
359+ if self ._instance_template .is_port_specified () \
362360 else self ._initial_host_info .port
363361 writer_host_info = HostInfo (
364362 writer_host ,
0 commit comments