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

437d0a
From d249ea3316fcfaa203055d2b1f2c52423216e7e7 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
437d0a
index 579e064..89e5c8e 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
437d0a
 from .exception import RuleNotConditional
437d0a
@@ -124,7 +124,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
437d0a
@@ -163,7 +163,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
437d0a
@@ -197,7 +197,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
-- 
437d0a
2.25.1
e6e076