mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 08:41:55 -06:00
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:
parent
a001095856
commit
23cfc9bd11
@ -334,16 +334,17 @@ 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:
|
||||||
if ruv.startswith('{replicageneration'):
|
for ruv in e[1]['nsds50ruv']:
|
||||||
continue
|
if ruv.startswith('{replicageneration'):
|
||||||
data = re.match('\{replica (\d+) (ldap://.*:\d+)\}(\s+\w+\s+\w*){0,1}', ruv)
|
continue
|
||||||
if data:
|
data = re.match('\{replica (\d+) (ldap://.*:\d+)\}(\s+\w+\s+\w*){0,1}', ruv)
|
||||||
rid = data.group(1)
|
if data:
|
||||||
(scheme, netloc, path, params, query, fragment) = urlparse.urlparse(data.group(2))
|
rid = data.group(1)
|
||||||
servers.append((netloc, rid))
|
(scheme, netloc, path, params, query, fragment) = urlparse.urlparse(data.group(2))
|
||||||
else:
|
servers.append((netloc, rid))
|
||||||
print "unable to decode: %s" % ruv
|
else:
|
||||||
|
print "unable to decode: %s" % ruv
|
||||||
|
|
||||||
return servers
|
return servers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user