summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-csreplica-manage
diff options
context:
space:
mode:
Diffstat (limited to 'install/tools/ipa-csreplica-manage')
-rwxr-xr-xinstall/tools/ipa-csreplica-manage26
1 files changed, 16 insertions, 10 deletions
diff --git a/install/tools/ipa-csreplica-manage b/install/tools/ipa-csreplica-manage
index db368c6fa..997bbc4e4 100755
--- a/install/tools/ipa-csreplica-manage
+++ b/install/tools/ipa-csreplica-manage
@@ -217,9 +217,9 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose):
try:
cadn = DN(('cn', 'CA'), DN(ent.dn))
entry = conn.getEntry(cadn, ldap.SCOPE_BASE)
- peers[ent.getValue('cn')] = ['master', '']
+ peers[ent.single_value('cn')] = ['master', '']
except errors.NotFound:
- peers[ent.getValue('cn')] = ['CA not configured', '']
+ peers[ent.single_value('cn')] = ['CA not configured', '']
except Exception, e:
sys.exit("Failed to get data from '%s' while trying to list replicas: %s" % (host, convert_error(e)))
@@ -235,13 +235,19 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose):
entries = repl.find_replication_agreements()
for entry in entries:
- print '%s' % entry.getValue('nsds5replicahost')
+ print '%s' % entry.single_value('nsds5replicahost', None)
if verbose:
- print " last init status: %s" % entry.getValue('nsds5replicalastinitstatus')
- print " last init ended: %s" % str(ipautil.parse_generalized_time(entry.getValue('nsds5replicalastinitend')))
- print " last update status: %s" % entry.getValue('nsds5replicalastupdatestatus')
- print " last update ended: %s" % str(ipautil.parse_generalized_time(entry.getValue('nsds5replicalastupdateend')))
+ print " last init status: %s" % entry.single_value(
+ 'nsds5replicalastinitstatus', None)
+ print " last init ended: %s" % str(
+ ipautil.parse_generalized_time(
+ entry.single_value('nsds5replicalastinitend')))
+ print " last update status: %s" % entry.single_value(
+ 'nsds5replicalastupdatestatus', None)
+ print " last update ended: %s" % str(
+ ipautil.parse_generalized_time(
+ entry.single_value('nsds5replicalastupdateend')))
def del_link(realm, replica1, replica2, dirman_passwd, force=False):
@@ -257,7 +263,7 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
# Find the DN of the replication agreement to remove
replica1_dn = None
for e in repl_list1:
- if e.getValue('nsDS5ReplicaHost') == replica2:
+ if e.single_value('nsDS5ReplicaHost', None) == replica2:
replica1_dn = e.dn
break
@@ -293,7 +299,7 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
# Find the DN of the replication agreement to remove
replica2_dn = None
for e in repl_list:
- if e.getValue('nsDS5ReplicaHost') == replica1:
+ if e.single_value('nsDS5ReplicaHost', None) == replica1:
replica2_dn = e.dn
break
@@ -401,7 +407,7 @@ def add_link(realm, replica1, replica2, dirman_passwd, options):
repl1 = get_cs_replication_manager(realm, replica1, dirman_passwd)
entries = repl1.find_replication_agreements()
for e in entries:
- if e.getValue('nsDS5ReplicaHost') == replica2:
+ if e.single_value('nsDS5ReplicaHost', None) == replica2:
sys.exit('This replication agreement already exists.')
repl1.hostnames = [replica1, replica2]