Handle the case where there are no replicas with list-ruv

This assumed that at least was returned by LDAP. This is not the case
if no replicas have ever been created.

https://fedorahosted.org/freeipa/ticket/3229
This commit is contained in:
Rob Crittenden 2012-11-06 17:31:11 -05:00 committed by Martin Kosek
parent a001095856
commit 23cfc9bd11

View File

@ -334,7 +334,8 @@ def get_ruv(realm, host, dirman_passwd):
sys.exit(0) sys.exit(0)
servers = [] servers = []
for ruv in entries[0][1]['nsds50ruv']: for e in entries:
for ruv in e[1]['nsds50ruv']:
if ruv.startswith('{replicageneration'): if ruv.startswith('{replicageneration'):
continue continue
data = re.match('\{replica (\d+) (ldap://.*:\d+)\}(\s+\w+\s+\w*){0,1}', ruv) data = re.match('\{replica (\d+) (ldap://.*:\d+)\}(\s+\w+\s+\w*){0,1}', ruv)