From 21cba48297103a528edbc21ce04ee254d83bf151 Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Mon, 15 Apr 2019 16:19:16 +0530 Subject: Use py2/3 compatible string type checks Replace usage of "types.StringTypes" with "six.string_types", because the latter one is compatible with both - py2 and py3. Change-Id: Ie8f9495914fca527da086af0915130470e3fd3e0 --- openshift-storage-libs/openshiftstoragelibs/openshift_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openshift-storage-libs/openshiftstoragelibs/openshift_ops.py') diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py index 7e300645..57c4dee7 100644 --- a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py +++ b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py @@ -11,11 +11,11 @@ except ImportError: # py2 import json import re -import types from glusto.core import Glusto as g from glustolibs.gluster import volume_ops import mock +import six import yaml from openshiftstoragelibs import command @@ -201,7 +201,7 @@ def oc_rsh(ocp_node, pod_name, command, log_level=None): A tuple consisting of the command return code, stdout, and stderr. """ prefix = ['oc', 'rsh', pod_name] - if isinstance(command, types.StringTypes): + if isinstance(command, six.string_types): cmd = ' '.join(prefix + [command]) else: cmd = prefix + command -- cgit