diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-03-21 16:04:57 +0530 |
---|---|---|
committer | Valerii Ponomarov <vponomar@redhat.com> | 2019-04-11 16:48:36 +0530 |
commit | 5fe05c3d09126453423a3d2ee97a4586ec6592c1 (patch) | |
tree | cc8d28f20c2e6fc29d172bae2744f66a62d1b336 /openshift-storage-libs/openshiftstoragelibs/gluster_ops.py | |
parent | 6497ec872180781c4131e7e2f901c1f84a9f5853 (diff) |
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
Diffstat (limited to 'openshift-storage-libs/openshiftstoragelibs/gluster_ops.py')
-rw-r--r-- | openshift-storage-libs/openshiftstoragelibs/gluster_ops.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py b/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py index 8ac95d82..798e3c2a 100644 --- a/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py +++ b/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py @@ -1,6 +1,11 @@ -import time -import json +try: + # py2/3 + import simplejson as json +except ImportError: + # py2 + import json import re +import time from glusto.core import Glusto as g from glustolibs.gluster.block_ops import block_list |