diff options
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/ipa_restore.py | 9 | ||||
-rw-r--r-- | ipaserver/install/plugins/fix_replica_agreements.py | 13 | ||||
-rw-r--r-- | ipaserver/install/replication.py | 9 |
3 files changed, 18 insertions, 13 deletions
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py index 04d42100c..760da0baf 100644 --- a/ipaserver/install/ipa_restore.py +++ b/ipaserver/install/ipa_restore.py @@ -373,7 +373,10 @@ class Restore(admintool.AdminTool): services_cns = [s.single_value('cn') for s in services] - hosts = repl.find_ipa_replication_agreements() + host_entries = repl.find_ipa_replication_agreements() + hosts = [rep.single_value('nsds5replicahost', None) + for rep in host_entries] + for host in hosts: self.log.info('Disabling replication agreement on %s to %s' % (master, host)) repl.disable_agreement(host) @@ -385,7 +388,9 @@ class Restore(admintool.AdminTool): except Exception, e: self.log.critical("Unable to disable agreement on %s: %s" % (master, e)) - hosts = repl.find_ipa_replication_agreements() + host_entries = repl.find_ipa_replication_agreements() + hosts = [rep.single_value('nsds5replicahost', None) + for rep in host_entries] for host in hosts: self.log.info('Disabling CA replication agreement on %s to %s' % (master, host)) repl.hostnames = [master, host] diff --git a/ipaserver/install/plugins/fix_replica_agreements.py b/ipaserver/install/plugins/fix_replica_agreements.py index 472e50217..4f6569249 100644 --- a/ipaserver/install/plugins/fix_replica_agreements.py +++ b/ipaserver/install/plugins/fix_replica_agreements.py @@ -34,7 +34,8 @@ class update_replica_attribute_lists(PreUpdate): has all the required attributes so that we don't cause replication storms. """ - order=MIDDLE + + order = MIDDLE def execute(self, **options): # We need an IPAdmin connection to the backend @@ -44,9 +45,13 @@ class update_replica_attribute_lists(PreUpdate): repl = replication.ReplicationManager(api.env.realm, api.env.host, None, conn=conn) - entries = repl.find_replication_agreements() - self.log.debug("Found %d agreement(s)", len(entries)) - for replica in entries: + + # We need to update only IPA replica agreements, not winsync + ipa_replicas = repl.find_ipa_replication_agreements() + + self.log.debug("Found %d agreement(s)", len(ipa_replicas)) + + for replica in ipa_replicas: self.log.debug(replica.single_value('description', None)) self._update_attr(repl, replica, diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index 64c3902a5..6269ba686 100644 --- a/ipaserver/install/replication.py +++ b/ipaserver/install/replication.py @@ -307,20 +307,15 @@ class ReplicationManager(object): Return the list of hosts we have replication agreements. """ - res = [] - filt = self.get_agreement_filter(IPA_REPLICA) try: ents = self.conn.get_entries( DN(('cn', 'mapping tree'), ('cn', 'config')), ldap.SCOPE_SUBTREE, filt) except errors.NotFound: - return res - - for ent in ents: - res.append(ent.single_value('nsds5replicahost', None)) + ents = [] - return res + return ents def get_replication_agreement(self, hostname): """ |