summaryrefslogtreecommitdiff
path: root/zuul/ansible
diff options
context:
space:
mode:
authorClint Byrum <clint@fewbar.com>2018-09-08 21:38:01 -0700
committerClint Byrum <clint@fewbar.com>2018-09-08 21:42:07 -0700
commit675f10d2712a49a62cd8a172585578e57ada817a (patch)
tree4a994472febd381e1831825d43298e539726c9ff /zuul/ansible
parentbde27fa4eca5a4ea92a0eadf6ebb32834bca719a (diff)
downloadzuul-675f10d2712a49a62cd8a172585578e57ada817a.tar.gz
python3: Can't have unbuffered non-binary I/O
The console daemon has, thus far, primarily been tested on python2 for various reasons. However, when forcing it to python3 by setting ansible_python_interpreter=/usr/bin/python3, we find that the console daemon explodes because Python 3 does not allow unbuffered I/O on non-binary files. It should be fine to have /dev/null be binary mode, as it is just being used to do low-level fileno() operations, the file ojbect is discarded shortly thereafter. Change-Id: Ib030863c2de17825e29874733fc5a9b023f7a601
Diffstat (limited to 'zuul/ansible')
-rw-r--r--zuul/ansible/library/zuul_console.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/zuul/ansible/library/zuul_console.py b/zuul/ansible/library/zuul_console.py
index 6703cc12b..6f5a86f2b 100644
--- a/zuul/ansible/library/zuul_console.py
+++ b/zuul/ansible/library/zuul_console.py
@@ -49,7 +49,7 @@ def daemonize():
sys.stderr.flush()
i = open('/dev/null', 'r')
o = open('/dev/null', 'a+')
- e = open('/dev/null', 'a+', 0)
+ e = open('/dev/null', 'ab+', 0)
os.dup2(i.fileno(), sys.stdin.fileno())
os.dup2(o.fileno(), sys.stdout.fileno())
os.dup2(e.fileno(), sys.stderr.fileno())