From 3fd3cd3a07d9f000c8cb8bd1b7a49ac2af675696 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Wed, 18 Jan 2017 12:06:49 -0500 Subject: Adding a few updates for python27,35 compatibility --- roles/lib_openshift/library/oc_edit.py | 8 ++++---- roles/lib_openshift/library/oc_route.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'roles/lib_openshift/library') diff --git a/roles/lib_openshift/library/oc_edit.py b/roles/lib_openshift/library/oc_edit.py index f78cbf2b3..d44f0da88 100644 --- a/roles/lib_openshift/library/oc_edit.py +++ b/roles/lib_openshift/library/oc_edit.py @@ -947,14 +947,14 @@ class OpenShiftCLI(object): try: rval['results'] = json.loads(stdout) except ValueError as err: - if "No JSON object could be decoded" in str(err): - err = str(err) + if "No JSON object could be decoded" in err.args: + err = err.args elif output_type == 'raw': rval['results'] = stdout if self.verbose: - print(stdout) - print(stderr) + print("STDOUT: {0}".format(stdout)) + print("STDERR: {0}".format(stderr)) if err: rval.update({"err": err, diff --git a/roles/lib_openshift/library/oc_route.py b/roles/lib_openshift/library/oc_route.py index de186ded7..04301a177 100644 --- a/roles/lib_openshift/library/oc_route.py +++ b/roles/lib_openshift/library/oc_route.py @@ -951,14 +951,14 @@ class OpenShiftCLI(object): try: rval['results'] = json.loads(stdout) except ValueError as err: - if "No JSON object could be decoded" in str(err): - err = str(err) + if "No JSON object could be decoded" in err.args: + err = err.args elif output_type == 'raw': rval['results'] = stdout if self.verbose: - print(stdout) - print(stderr) + print("STDOUT: {0}".format(stdout)) + print("STDERR: {0}".format(stderr)) if err: rval.update({"err": err, -- cgit v1.2.3