summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins/location.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-06-16 19:13:45 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-17 18:05:03 +0200
commit4155eb7b13b20605886ba79c02c232f83a7b439c (patch)
tree310f70edd61952e24c4582b844c087a09ca65ce5 /ipaserver/plugins/location.py
parent3c50e42036427d7c5e36828f24bd3c180e18a677 (diff)
downloadfreeipa-4155eb7b13b20605886ba79c02c232f83a7b439c.tar.gz
freeipa-4155eb7b13b20605886ba79c02c232f83a7b439c.tar.xz
freeipa-4155eb7b13b20605886ba79c02c232f83a7b439c.zip
DNS Locations: Rename ipalocationweight to ipaserviceweight
Service weight explains better meaning of attribute than location weight, because location itself have no weight only services have. https://fedorahosted.org/freeipa/ticket/2008 Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipaserver/plugins/location.py')
-rw-r--r--ipaserver/plugins/location.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipaserver/plugins/location.py b/ipaserver/plugins/location.py
index 1de51df63..2a7e681ae 100644
--- a/ipaserver/plugins/location.py
+++ b/ipaserver/plugins/location.py
@@ -202,12 +202,12 @@ class location_show(LDAPRetrieve):
in_location=keys[0], no_members=False)['result']
for server in servers:
servers_name.append(server['cn'][0])
- weight = int(server.get('ipalocationweight', [100])[0])
+ weight = int(server.get('ipaserviceweight', [100])[0])
weight_sum += weight
servers_additional_info[server['cn'][0]] = {
'cn': server['cn'],
- 'ipalocationweight': server.get(
- 'ipalocationweight', [u'100']),
+ 'ipaserviceweight': server.get(
+ 'ipaserviceweight', [u'100']),
}
if not dns_server_in_loc:
@@ -218,9 +218,9 @@ class location_show(LDAPRetrieve):
dns_server_in_loc = True
for server in servers_additional_info.values():
- server['location_relative_weight'] = [
+ server['service_relative_weight'] = [
u'{:.1f}%'.format(
- int(server['ipalocationweight'][0])*100.0/weight_sum)
+ int(server['ipaserviceweight'][0])*100.0/weight_sum)
]
if servers_name:
result['result']['servers_server'] = servers_name