diff options
author | Victor Stinner <vstinner@redhat.com> | 2015-07-01 17:48:54 +0200 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2015-07-10 10:42:32 +0200 |
commit | b2c55421d6fa2cc53254f901b2faa76b09455130 (patch) | |
tree | 3c0022ad70480fec51c15b155fe4f98bfab7ae9f /tox.ini | |
parent | 22c3e7437a2757c9b55a0245c63a1f349209c99a (diff) | |
download | nova-b2c55421d6fa2cc53254f901b2faa76b09455130.tar.gz |
Port crypto to Python 3
Fix bytes vs Unicode issues:
* ssh_encrypt_text() now encodes text to UTF-8 if text type is Unicode.
* Encode Unicode to ASCII before encoding it to base64
* On Python 3, decode binascii.hexlify() and base64.encodestring()
output from ASCII to get Unicode (str type in Python 3) is required.
* convert_from_sshrsa_to_pkcs8(): reuse binascii.hexlify() instead of
a loop using struck.unpack() and "%02X" format.
* Replace str.encode('hex') with binascii.hexlify(str)
* Replace string.strip(text) with text.strip()
* Replace StringIO.StringIO with six.StringIO
* Add test on the output type of ssh_encrypt_text() and decrypt_text()
* Call utils.execute() with binary=True to not decode stdout/stderr
(to get them as raw bytes).
* Replace reduce() with six.moves.reduce()
* convert_version_to_str(): replace a/b with a//b to get integer
division
* tox.ini: add the following tests to Python 3.4
- nova.tests.unit.compute.test_keypairs
- nova.tests.unit.test_crypto
Blueprint nova-python3
Change-Id: I83d927166c0864020b205ac7495473795da7830d
Diffstat (limited to 'tox.ini')
-rw-r--r-- | tox.ini | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -36,9 +36,8 @@ deps = -r{toxinidir}/requirements.txt commands = find . -type f -name "*.pyc" -delete python -m testtools.run \ - nova.tests.unit.test_exception \ + nova.tests.unit.compute.test_keypairs \ nova.tests.unit.db.test_db_api \ - nova.tests.unit.test_versions \ nova.tests.unit.objects.test_agent \ nova.tests.unit.objects.test_aggregate \ nova.tests.unit.objects.test_bandwidth_usage \ @@ -76,7 +75,10 @@ commands = nova.tests.unit.objects.test_tag \ nova.tests.unit.objects.test_vcpu_model \ nova.tests.unit.objects.test_virt_cpu_topology \ - nova.tests.unit.objects.test_virtual_interface + nova.tests.unit.objects.test_virtual_interface \ + nova.tests.unit.test_crypto \ + nova.tests.unit.test_exception \ + nova.tests.unit.test_versions [testenv:functional] usedevelop = True |