From 5fe05c3d09126453423a3d2ee97a4586ec6592c1 Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Thu, 21 Mar 2019 16:04:57 +0530 Subject: Add py3 support to our tox config and fix several incompatibilities Required steps to run test cases using py3: 1) Install py3 2) Install 'tox' package using "pip3" 3) Run test cases using tox package installed via pip3 Note that full py3 support is not tested yet. It only allows you to run it on py3 not providing any guarantees. Example: $ python3 -m tox -e functional3 -- \ glusto -c /path/to/the/config/file.yaml \ '--pytest=-v -rsx tests -k test_glusterblock_logs' Change-Id: I610faac0b75364c401734b6f892649893ca2320e --- openshift-storage-libs/openshiftstoragelibs/naming.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'openshift-storage-libs/openshiftstoragelibs/naming.py') diff --git a/openshift-storage-libs/openshiftstoragelibs/naming.py b/openshift-storage-libs/openshiftstoragelibs/naming.py index b44559ad..3d97c3e0 100644 --- a/openshift-storage-libs/openshiftstoragelibs/naming.py +++ b/openshift-storage-libs/openshiftstoragelibs/naming.py @@ -7,7 +7,12 @@ import re # we only use lowercase here because kubernetes requires # names to be lowercase or digits, so that is our default -UNIQUE_CHARS = (string.lowercase + string.digits) +try: + # py2 + UNIQUE_CHARS = (string.lowercase + string.digits) +except AttributeError: + # py3 + UNIQUE_CHARS = (string.ascii_lowercase + string.digits) def make_unique_label(prefix=None, suffix=None, sep='-', -- cgit