diff options
author | Martin Babinsky <mbabinsk@redhat.com> | 2016-06-08 18:16:24 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-06-17 18:55:19 +0200 |
commit | d8ae2b4055284de8c1baf76819d6611978f83cc6 (patch) | |
tree | 58d295c0fd771af79b06160fb845de92d33d3562 /ipalib/util.py | |
parent | 45bb2ad045654c020fe6ac4e77ed2741cd35d717 (diff) | |
download | freeipa-d8ae2b4055284de8c1baf76819d6611978f83cc6.tar.gz freeipa-d8ae2b4055284de8c1baf76819d6611978f83cc6.tar.xz freeipa-d8ae2b4055284de8c1baf76819d6611978f83cc6.zip |
ipaserver module for working with managed topology
This module should aggregate common functionality utilized in the commands
managing domain-level 1 topology.
https://fedorahosted.org/freeipa/ticket/5588
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipalib/util.py')
-rw-r--r-- | ipalib/util.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/ipalib/util.py b/ipalib/util.py index 68d11fc6c..8435f7ab6 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -45,7 +45,6 @@ from ipapython.ssh import SSHPublicKey from ipapython.dn import DN, RDN from ipapython.dnsutil import DNSName from ipapython.dnsutil import resolve_ip_addresses -from ipapython.graph import Graph if six.PY3: unicode = str @@ -765,55 +764,6 @@ def validate_idna_domain(value): raise ValueError(error) -def create_topology_graph(masters, segments): - """ - Create an oriented graph from topology defined by masters and segments. - - :param masters - :param segments - :returns: Graph - """ - graph = Graph() - - for m in masters: - graph.add_vertex(m['cn'][0]) - - for s in segments: - direction = s['iparepltoposegmentdirection'][0] - left = s['iparepltoposegmentleftnode'][0] - right = s['iparepltoposegmentrightnode'][0] - try: - if direction == u'both': - graph.add_edge(left, right) - graph.add_edge(right, left) - elif direction == u'left-right': - graph.add_edge(left, right) - elif direction == u'right-left': - graph.add_edge(right, left) - except ValueError: # ignore segments with deleted master - pass - - return graph - - -def get_topology_connection_errors(graph): - """ - Traverse graph from each master and find out which masters are not - reachable. - - :param graph: topology graph where vertices are masters - :returns: list of errors, error is: (master, visited, not_visited) - """ - connect_errors = [] - master_cns = list(graph.vertices) - master_cns.sort() - for m in master_cns: - visited = graph.bfs(m) - not_visited = graph.vertices - visited - if not_visited: - connect_errors.append((m, list(visited), list(not_visited))) - return connect_errors - def detect_dns_zone_realm_type(api, domain): """ Detects the type of the realm that the given DNS zone belongs to. |