diff options
author | Jan Cholasta <jcholast@redhat.com> | 2013-09-10 10:20:24 +0000 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2013-11-05 13:56:55 +0100 |
commit | df5f4ee81d1aff1122dd92ab1b56eb335294c3a7 (patch) | |
tree | b112b429a896789029038bd3e25218495b647d56 /install/tools/ipa-csreplica-manage | |
parent | 989493979da3ef1136a9b346cace5689ef22eed8 (diff) | |
download | freeipa-df5f4ee81d1aff1122dd92ab1b56eb335294c3a7.tar.gz freeipa-df5f4ee81d1aff1122dd92ab1b56eb335294c3a7.tar.xz freeipa-df5f4ee81d1aff1122dd92ab1b56eb335294c3a7.zip |
Turn LDAPEntry.single_value into a dictionary-like property.
This change makes single_value consistent with the raw property.
https://fedorahosted.org/freeipa/ticket/3521
Diffstat (limited to 'install/tools/ipa-csreplica-manage')
-rwxr-xr-x | install/tools/ipa-csreplica-manage | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/install/tools/ipa-csreplica-manage b/install/tools/ipa-csreplica-manage index ce027be12..438a1b3ab 100755 --- a/install/tools/ipa-csreplica-manage +++ b/install/tools/ipa-csreplica-manage @@ -100,9 +100,9 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose): try: cadn = DN(('cn', 'CA'), DN(ent.dn)) entry = conn.get_entry(cadn) - peers[ent.single_value('cn')] = ['master', ''] + peers[ent.single_value['cn']] = ['master', ''] except errors.NotFound: - peers[ent.single_value('cn')] = ['CA not configured', ''] + peers[ent.single_value['cn']] = ['CA not configured', ''] except Exception, e: sys.exit( @@ -124,19 +124,19 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose): entries = repl.find_replication_agreements() for entry in entries: - print '%s' % entry.single_value('nsds5replicahost', None) + print '%s' % entry.single_value.get('nsds5replicahost') if verbose: - print " last init status: %s" % entry.single_value( - 'nsds5replicalastinitstatus', None) + print " last init status: %s" % entry.single_value.get( + 'nsds5replicalastinitstatus') print " last init ended: %s" % str( ipautil.parse_generalized_time( - entry.single_value('nsds5replicalastinitend'))) - print " last update status: %s" % entry.single_value( - 'nsds5replicalastupdatestatus', None) + entry.single_value['nsds5replicalastinitend'])) + print " last update status: %s" % entry.single_value.get( + 'nsds5replicalastupdatestatus') print " last update ended: %s" % str( ipautil.parse_generalized_time( - entry.single_value('nsds5replicalastupdateend'))) + entry.single_value['nsds5replicalastupdateend'])) def del_link(realm, replica1, replica2, dirman_passwd, force=False): @@ -152,7 +152,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.single_value('nsDS5ReplicaHost', None) == replica2: + if e.single_value.get('nsDS5ReplicaHost') == replica2: replica1_dn = e.dn break @@ -188,7 +188,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.single_value('nsDS5ReplicaHost', None) == replica1: + if e.single_value.get('nsDS5ReplicaHost') == replica1: replica2_dn = e.dn break @@ -263,7 +263,7 @@ def del_master(realm, hostname, options): replica_names = [options.host] else: replica_entries = delrepl.find_ipa_replication_agreements() - replica_names = [rep.single_value('nsds5replicahost', None) + replica_names = [rep.single_value.get('nsds5replicahost') for rep in replica_entries] # 5. Remove each agreement @@ -311,7 +311,7 @@ def add_link(realm, replica1, replica2, dirman_passwd, options): dirman_passwd) entries = repl1.find_replication_agreements() for e in entries: - if e.single_value('nsDS5ReplicaHost', None) == replica2: + if e.single_value.get('nsDS5ReplicaHost') == replica2: sys.exit('This replication agreement already exists.') repl1.hostnames = [replica1, replica2] |