summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Pattrick <mkp@redhat.com>2023-03-21 09:56:16 -0400
committerIlya Maximets <i.maximets@ovn.org>2023-03-22 20:02:13 +0100
commitb3935cf90e31da0bb9ce8a99df62616c64446a49 (patch)
tree86a3b59072c977af3be6b0beb471c8ec66203140 /tests
parent07cf5810de8da12c700324bc421bde92376abe06 (diff)
downloadopenvswitch-b3935cf90e31da0bb9ce8a99df62616c64446a49.tar.gz
tests/mfex: Retain support for cryptography pre-v37.
Prior to v37.0.0, CryptographyDeprecationWarning could not be imported from __init__.py resulting in: Traceback (most recent call last): File "mfex_fuzzy.py", line 9, in <module> category=cryptography.CryptographyDeprecationWarning, AttributeError: module 'cryptography' has no attribute 'CryptographyDeprecationWarning' This import was only added to __init__ to deprecate python3.6. Importing the exception from cryptography.utils is the compatible option. Fixes: c3ed0bf34b8a ("tests/mfex: Silence Blowfish/CAST5 deprecation warnings.") Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/mfex_fuzzy.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py
index 15f7f4e51..30028ba7a 100755
--- a/tests/mfex_fuzzy.py
+++ b/tests/mfex_fuzzy.py
@@ -3,12 +3,13 @@
import sys
import warnings
-import cryptography
+from cryptography.utils import CryptographyDeprecationWarning
warnings.filterwarnings(
"ignore",
- category=cryptography.CryptographyDeprecationWarning,
+ category=CryptographyDeprecationWarning,
message=r"(blowfish|cast5)",
)
+
# flake8: noqa: E402
from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6, RandShort, fuzz
from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP, random