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>
This commit is contained in:
Martin Basti
2016-06-16 19:13:45 +02:00
parent 3c50e42036
commit 4155eb7b13
11 changed files with 36 additions and 36 deletions

View File

@@ -177,11 +177,11 @@ class TestLocationsServer(XMLRPC_test):
server.update(
dict(
ipalocation_location=location.idnsname_obj,
ipalocationweight=200,
ipaserviceweight=200,
),
expected_updates=dict(
ipalocation_location=[location.idnsname_obj],
ipalocationweight=[u'200'],
ipaserviceweight=[u'200'],
)
)
# remove invalid data from the previous test
@@ -195,6 +195,6 @@ class TestLocationsServer(XMLRPC_test):
location.remove_server_from_location(server.server_name)
location.retrieve()
def test_remove_location_weight_from_server(self, location, server):
server.update(dict(ipalocationweight=None))
def test_remove_service_weight_from_server(self, location, server):
server.update(dict(ipaserviceweight=None))
location.retrieve()

View File

@@ -132,8 +132,8 @@ class LocationTracker(Tracker):
self.attrs.setdefault('servers_server', []).append(server_name)
self.servers[server_name] = {
'cn': [server_name],
'ipalocationweight': [unicode(weight)],
'location_relative_weight': [relative_weight]
'ipaserviceweight': [unicode(weight)],
'service_relative_weight': [relative_weight]
}
def remove_server_from_location(self, server_name):

View File

@@ -13,18 +13,18 @@ class ServerTracker(Tracker):
retrieve_keys = {
'cn', 'dn', 'ipamaxdomainlevel', 'ipamindomainlevel',
'iparepltopomanagedsuffix_topologysuffix', 'ipalocation_location',
'ipalocationweight',
'ipaserviceweight',
}
retrieve_all_keys = retrieve_keys | {'objectclass'}
create_keys = retrieve_keys | {'objectclass'}
find_keys = {
'cn', 'dn', 'ipamaxdomainlevel', 'ipamindomainlevel',
'ipalocationweight',
'ipaserviceweight',
}
find_all_keys = retrieve_all_keys
update_keys = {
'cn', 'ipamaxdomainlevel', 'ipamindomainlevel',
'ipalocation_location', 'ipalocationweight',
'ipalocation_location', 'ipaserviceweight',
}
def __init__(self, name):