Blame SOURCES/1003-Do-not-use-NoteNotFound-as-it-s-not-implemented-in-n.patch

e6e076
From acfb532e781d600271e5ab1ebc5d9d6d6ea3a7f8 Mon Sep 17 00:00:00 2001
e6e076
From: Petr Lautrbach <plautrba@redhat.com>
e6e076
Date: Tue, 30 Jul 2019 17:13:44 +0200
e6e076
Subject: [PATCH] Do not use NoteNotFound as it's not implemented in networkx-1
e6e076
e6e076
---
e6e076
 setools/dta.py      | 8 ++++----
e6e076
 setools/infoflow.py | 8 ++++----
e6e076
 2 files changed, 8 insertions(+), 8 deletions(-)
e6e076
e6e076
diff --git a/setools/dta.py b/setools/dta.py
e6e076
index 3239d2d..e15d8b8 100644
e6e076
--- a/setools/dta.py
e6e076
+++ b/setools/dta.py
e6e076
@@ -24,7 +24,7 @@ from collections import defaultdict, namedtuple
e6e076
 from contextlib import suppress
e6e076
 
e6e076
 import networkx as nx
e6e076
-from networkx.exception import NetworkXError, NetworkXNoPath, NodeNotFound
e6e076
+from networkx.exception import NetworkXError, NetworkXNoPath
e6e076
 
e6e076
 from .descriptors import EdgeAttrDict, EdgeAttrList
e6e076
 from .policyrep import TERuletype
e6e076
@@ -111,7 +111,7 @@ class DomainTransitionAnalysis:
e6e076
 
e6e076
         self.log.info("Generating one domain transition path from {0} to {1}...".format(s, t))
e6e076
 
e6e076
-        with suppress(NetworkXNoPath, NodeNotFound):
e6e076
+        with suppress(NetworkXNoPath):
e6e076
             # NodeNotFound: the type is valid but not in graph, e.g. excluded
e6e076
             # NetworkXNoPath: no paths or the target type is
e6e076
             # not in the graph
e6e076
@@ -146,7 +146,7 @@ class DomainTransitionAnalysis:
e6e076
         self.log.info("Generating all domain transition paths from {0} to {1}, max length {2}...".
e6e076
                       format(s, t, maxlen))
e6e076
 
e6e076
-        with suppress(NetworkXNoPath, NodeNotFound):
e6e076
+        with suppress(NetworkXNoPath):
e6e076
             # NodeNotFound: the type is valid but not in graph, e.g. excluded
e6e076
             # NetworkXNoPath: no paths or the target type is
e6e076
             # not in the graph
e6e076
@@ -177,7 +177,7 @@ class DomainTransitionAnalysis:
e6e076
         self.log.info("Generating all shortest domain transition paths from {0} to {1}...".
e6e076
                       format(s, t))
e6e076
 
e6e076
-        with suppress(NetworkXNoPath, NodeNotFound):
e6e076
+        with suppress(NetworkXNoPath):
e6e076
             # NodeNotFound: the type is valid but not in graph, e.g. excluded
e6e076
             # NetworkXNoPath: no paths or the target type is
e6e076
             # not in the graph
e6e076
diff --git a/setools/infoflow.py b/setools/infoflow.py
e6e076
index 1b88efa..4fbe682 100644
e6e076
--- a/setools/infoflow.py
e6e076
+++ b/setools/infoflow.py
e6e076
@@ -21,7 +21,7 @@ import logging
e6e076
 from contextlib import suppress
e6e076
 
e6e076
 import networkx as nx
e6e076
-from networkx.exception import NetworkXError, NetworkXNoPath, NodeNotFound
e6e076
+from networkx.exception import NetworkXError, NetworkXNoPath
e6e076
 
e6e076
 from .descriptors import EdgeAttrIntMax, EdgeAttrList
e6e076
 from .policyrep import TERuletype
e6e076
@@ -118,7 +118,7 @@ class InfoFlowAnalysis:
e6e076
         self.log.info("Generating one shortest information flow path from {0} to {1}...".
e6e076
                       format(s, t))
e6e076
 
e6e076
-        with suppress(NetworkXNoPath, NodeNotFound):
e6e076
+        with suppress(NetworkXNoPath):
e6e076
             # NodeNotFound: the type is valid but not in graph, e.g.
e6e076
             # excluded or disconnected due to min weight
e6e076
             # NetworkXNoPath: no paths or the target type is
e6e076
@@ -157,7 +157,7 @@ class InfoFlowAnalysis:
e6e076
         self.log.info("Generating all information flow paths from {0} to {1}, max length {2}...".
e6e076
                       format(s, t, maxlen))
e6e076
 
e6e076
-        with suppress(NetworkXNoPath, NodeNotFound):
e6e076
+        with suppress(NetworkXNoPath):
e6e076
             # NodeNotFound: the type is valid but not in graph, e.g.
e6e076
             # excluded or disconnected due to min weight
e6e076
             # NetworkXNoPath: no paths or the target type is
e6e076
@@ -191,7 +191,7 @@ class InfoFlowAnalysis:
e6e076
         self.log.info("Generating all shortest information flow paths from {0} to {1}...".
e6e076
                       format(s, t))
e6e076
 
e6e076
-        with suppress(NetworkXNoPath, NodeNotFound):
e6e076
+        with suppress(NetworkXNoPath):
e6e076
             # NodeNotFound: the type is valid but not in graph, e.g.
e6e076
             # excluded or disconnected due to min weight
e6e076
             # NetworkXNoPath: no paths or the target type is
e6e076
-- 
e6e076
2.22.0
e6e076