From a62621f5ceda043b0e385b6e952ab55ef16ed866 Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Fri, 10 Jan 2025 11:40:51 -0800 Subject: [PATCH] Update replica.py --- src/lib389/lib389/replica.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib389/lib389/replica.py b/src/lib389/lib389/replica.py index bee954d550..b9341032cb 100644 --- a/src/lib389/lib389/replica.py +++ b/src/lib389/lib389/replica.py @@ -2013,7 +2013,7 @@ def _create_service_group(self, from_instance): return repl_group else: try: - repl_group = groups.get('replication_managers') + repl_group = groups.get(dn=f'cn=replication_managers,{self._suffix}') return repl_group except ldap.NO_SUCH_OBJECT: self._log.warning("{} doesn't have cn=replication_managers,{} entry \ @@ -2037,7 +2037,7 @@ def _create_service_account(self, from_instance, to_instance): services = ServiceAccounts(from_instance, self._suffix) # Generate the password and save the credentials # for putting them into agreements in the future - service_name = '{}:{}'.format(to_instance.host, port) + service_name = f'{self._suffix}:{to_instance.host}:{port}' creds = password_generate() repl_service = services.ensure_state(properties={ 'cn': service_name, @@ -2296,7 +2296,7 @@ def _get_replica_creds(self, from_instance, write_instance): Internal Only. """ - rdn = '{}:{}'.format(from_instance.host, from_instance.sslport) + rdn = f'{self._suffix}:{from_instance.host}:{from_instance.sslport}' try: creds = self._repl_creds[rdn] except KeyError: @@ -2537,8 +2537,8 @@ def wait_for_replication(self, from_instance, to_instance, timeout=60): # Touch something then wait_for_replication. from_groups = Groups(from_instance, basedn=self._suffix, rdn=None) to_groups = Groups(to_instance, basedn=self._suffix, rdn=None) - from_group = from_groups.get('replication_managers') - to_group = to_groups.get('replication_managers') + from_group = from_groups.get(dn=f'cn=replication_managers,{self._suffix}') + to_group = to_groups.get(dn=f'cn=replication_managers,{self._suffix}') change = str(uuid.uuid4())