From 4279fd253baf77fef8a5a8e6374f79e988d01d4b Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Tue, 27 Feb 2018 15:51:17 +0800 Subject: [PATCH] Remove pycrypto from requirements Remove pycrypto completely from requirements and fix the related tests. Closes-Bug: #1749574 Depends-On: I5c0c1a238023c116af5a84d899e629f1c7c3513f Change-Id: Ibfedd9e2ab0a5e78959108112f57103a089f02d1 Signed-off-by: Fan Zhang --- .../scripts/files/requirements/fedora-requirements.txt | 1 - .../scripts/files/requirements/ubuntu-requirements.txt | 1 - lower-constraints.txt | 1 - requirements.txt | 1 - trove/tests/scenario/runners/module_runners.py | 4 ++-- trove/tests/unittests/common/test_stream_codecs.py | 4 ++-- 6 files changed, 4 insertions(+), 8 deletions(-) diff --git a/integration/scripts/files/requirements/fedora-requirements.txt b/integration/scripts/files/requirements/fedora-requirements.txt index 5082c80171..0b09cb28bb 100644 --- a/integration/scripts/files/requirements/fedora-requirements.txt +++ b/integration/scripts/files/requirements/fedora-requirements.txt @@ -28,5 +28,4 @@ oslo.concurrency>=1.8.0 # Apache-2.0 pexpect>=3.1,!=3.3 enum34;python_version=='2.7' or python_version=='2.6' or python_version=='3.3' # BSD cryptography>=2.1.4 # BSD/Apache-2.0 -pycrypto>=2.6 # Public Domain xmltodict>=0.10.1 # MIT diff --git a/integration/scripts/files/requirements/ubuntu-requirements.txt b/integration/scripts/files/requirements/ubuntu-requirements.txt index b727454300..038ccca7b3 100644 --- a/integration/scripts/files/requirements/ubuntu-requirements.txt +++ b/integration/scripts/files/requirements/ubuntu-requirements.txt @@ -27,5 +27,4 @@ osprofiler>=0.3.0 oslo.concurrency>=0.3.0 enum34;python_version=='2.7' or python_version=='2.6' or python_version=='3.3' # BSD cryptography>=2.1.4 # BSD/Apache-2.0 -pycrypto>=2.6 # Public Domain xmltodict>=0.10.1 # MIT diff --git a/lower-constraints.txt b/lower-constraints.txt index cbce5ed2e7..6b072d2835 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -105,7 +105,6 @@ psycopg2==2.6.2 ptyprocess==0.5.2 pycadf==2.7.0 pycparser==2.18 -pycrypto==2.6 pyflakes==1.0.0 Pygments==2.2.0 pyinotify==0.9.6 diff --git a/requirements.txt b/requirements.txt index ba25ced71e..083ef63220 100644 --- a/requirements.txt +++ b/requirements.txt @@ -45,6 +45,5 @@ oslo.db>=4.27.0 # Apache-2.0 enum34>=1.0.4;python_version=='2.7' or python_version=='2.6' or python_version=='3.3' # BSD xmltodict>=0.10.1 # MIT cryptography>=2.1.4 # BSD/Apache-2.0 -pycrypto>=2.6 # Public Domain oslo.policy>=1.30.0 # Apache-2.0 diskimage-builder!=1.6.0,!=1.7.0,!=1.7.1,>=1.1.2 # Apache-2.0 diff --git a/trove/tests/scenario/runners/module_runners.py b/trove/tests/scenario/runners/module_runners.py index 3c1199b09a..c6483e31a8 100644 --- a/trove/tests/scenario/runners/module_runners.py +++ b/trove/tests/scenario/runners/module_runners.py @@ -14,7 +14,7 @@ # under the License. # -import Crypto.Random +import os from proboscis import SkipTest import re import tempfile @@ -42,7 +42,7 @@ def __init__(self): self.MODULE_NEG_CONTENTS = 'contents for negative tests' self.MODULE_BINARY_SUFFIX = '_bin_auto' self.MODULE_BINARY_SUFFIX2 = self.MODULE_BINARY_SUFFIX + '_2' - self.MODULE_BINARY_CONTENTS = Crypto.Random.new().read(20) + self.MODULE_BINARY_CONTENTS = os.urandom(20) self.MODULE_BINARY_CONTENTS2 = '\x00\xFF\xea\x9c\x11\xfeok\xb1\x8ax' self.module_name_order = [ diff --git a/trove/tests/unittests/common/test_stream_codecs.py b/trove/tests/unittests/common/test_stream_codecs.py index 6659bd05d7..1c303e0665 100644 --- a/trove/tests/unittests/common/test_stream_codecs.py +++ b/trove/tests/unittests/common/test_stream_codecs.py @@ -14,7 +14,7 @@ # under the License. # -from Crypto import Random +import os from trove.common import stream_codecs from trove.tests.unittests import trove_testtools @@ -29,7 +29,7 @@ def tearDown(self): super(TestStreamCodecs, self).tearDown() def test_serialize_deserialize_base64codec(self): - random_data = bytearray(Random.new().read(12)) + random_data = bytearray(os.urandom(12)) data = [b'abc', b'numbers01234', b'non-ascii:\xe9\xff',