This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository 389-ds-base.
commit 13cf56fca1e260fa11ec43e402d0d51ab654ff0b
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Nov 20 19:19:41 2013 -0700
add convenience agreement_dn method to get a single replication agreement dn
Reviewed by: tbordaz (Thanks!)
---
src/lib389/lib389/brooker.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/lib389/lib389/brooker.py b/src/lib389/lib389/brooker.py
index e067fba..58d4ffe 100644
--- a/src/lib389/lib389/brooker.py
+++ b/src/lib389/lib389/brooker.py
@@ -763,6 +763,23 @@ class Replica(object):
return [ent.dn for ent in ents]
return ents
+ def agreement_dn(self, basedn, oth):
+ '''get the replication agreement to the dirsrv object
+ specified by oth for the suffix basedn
+ this returns the replication agreement handle in a form suitable
+ for passing to agreement_changes, start_async, etc.'''
+ filt = '(nsds5replicahost=%s)(nsds5replicaport=%d)(nsds5replicaroot=%s)'
% \
+ (oth.host, oth.port, normalizeDN(basedn))
+ dns = self.agreements(filt, None, True)
+ if not dns:
+ self.log.error('no agreement found for host %s port %d suffix %s',
oth.host, oth.port, basedn)
+ return None
+ elif len(dns) > 1:
+ self.log.error('%d agreements found for host %s port %d suffix %s',
len(dns), oth.host, oth.port, basedn)
+ return None
+ else:
+ return dns[0]
+
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.