summaryrefslogtreecommitdiffstats
path: root/base/server/upgrade/10.1.99/03-AddedRESTEasyClient
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2015-08-16 19:00:00 +0200
committerChristian Heimes <cheimes@redhat.com>2015-08-17 21:14:12 +0200
commit0ab2ba73018675187ed932dc0b421488af17600a (patch)
tree8cef2fc045bcdbca93c947ec7ed0bdc088e478be /base/server/upgrade/10.1.99/03-AddedRESTEasyClient
parent74a355185eeb30e7d42ff2d29c4c3c3c298b2a12 (diff)
downloadpki-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-xbase/server/upgrade/10.1.99/03-AddedRESTEasyClient4
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')