ipa-replica-manage del: relax segment deletement check if topology is disconnected

https://fedorahosted.org/freeipa/ticket/5072

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Petr Vobornik
2015-06-26 18:09:19 +02:00
committed by Tomas Babej
parent 76eea85701
commit 6be7d41ba1
2 changed files with 43 additions and 6 deletions

View File

@@ -29,11 +29,18 @@ class Graph():
self._adj[tail].append(head)
def remove_edge(self, tail, head):
self.edges.remove((tail, head))
try:
self.edges.remove((tail, head))
except KeyError:
raise ValueError(
"graph does not contain edge: (%s, %s)" % (tail, head))
self._adj[tail].remove(head)
def remove_vertex(self, vertex):
self.vertices.remove(vertex)
try:
self.vertices.remove(vertex)
except KeyError:
raise ValueError("graph does not contain vertex: %s" % vertex)
# delete _adjacencies
del self._adj[vertex]