diff options
author | Christian Heimes <cheimes@redhat.com> | 2015-08-16 19:00:00 +0200 |
---|---|---|
committer | Christian Heimes <cheimes@redhat.com> | 2015-08-17 21:14:12 +0200 |
commit | 0ab2ba73018675187ed932dc0b421488af17600a (patch) | |
tree | 8cef2fc045bcdbca93c947ec7ed0bdc088e478be /base/server/upgrade/10.1.99/03-AddedRESTEasyClient | |
parent | 74a355185eeb30e7d42ff2d29c4c3c3c298b2a12 (diff) | |
download | pki-0ab2ba73018675187ed932dc0b421488af17600a.tar.gz pki-0ab2ba73018675187ed932dc0b421488af17600a.tar.xz pki-0ab2ba73018675187ed932dc0b421488af17600a.zip |
Py3 compatibility: encode output of subprocess call
In Python 3 subprocess.Popen() and check_out() return bytes. The rest of
PKI expects text, so the output has to be decoded.
- ascii for dnsdomainname
- sys.getfilesystemencoding() for paths
- utf-8 for the rest
Diffstat (limited to 'base/server/upgrade/10.1.99/03-AddedRESTEasyClient')
-rwxr-xr-x | base/server/upgrade/10.1.99/03-AddedRESTEasyClient | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/base/server/upgrade/10.1.99/03-AddedRESTEasyClient b/base/server/upgrade/10.1.99/03-AddedRESTEasyClient index 40169bc66..c38e0a62f 100755 --- a/base/server/upgrade/10.1.99/03-AddedRESTEasyClient +++ b/base/server/upgrade/10.1.99/03-AddedRESTEasyClient @@ -21,6 +21,7 @@ from __future__ import absolute_import import os +import sys import subprocess import pki.server.upgrade @@ -41,8 +42,9 @@ class AddedRESTEasyClient(pki.server.upgrade.PKIServerUpgradeScriptlet): resteasy_lib = subprocess.check_output( '. /etc/pki/pki.conf && echo $RESTEASY_LIB', shell=True) + resteasy_lib = resteasy_lib.decode(sys.getfilesystemencoding()) # workaround for pylint error E1103 - resteasy_lib = str(resteasy_lib).strip() + resteasy_lib = resteasy_lib.strip() # create new links source = os.path.join(resteasy_lib, 'resteasy-client.jar') |