Merge "Pass sys.stdin.buffer to json.load() in Python 3"

This commit is contained in:
Zuul 2018-09-13 11:29:27 +00:00 committed by Gerrit Code Review
commit 7a8bd050c1
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@
import os
import signal
import six
import sys
import os_vif
@ -39,7 +40,11 @@ def run():
# REVISIT(ivc): current CNI implementation provided by this package is
# experimental and its primary purpose is to enable development of other
# components (e.g. functional tests, service/LBaaSv2 support)
cni_conf = utils.CNIConfig(jsonutils.load(sys.stdin))
if six.PY3:
d = jsonutils.load(sys.stdin.buffer)
else:
d = jsonutils.load(sys.stdin)
cni_conf = utils.CNIConfig(d)
args = ['--config-file', cni_conf.kuryr_conf]
try: