mirror of https://github.com/ansible/ansible.git
wait_for - Read file and perform comparisons using bytes to avoid decode errors (#78317)
* wait_for - Read file and perform comparisons using bytes to avoid decode errors. Fixes #78214 * Write non-ascii via script instead of static file * Use contexlib.closing to support py27 context manager * Use executable from task, instead of shebang * Update encoded bytes to utf16pull/78332/head
parent
0012263c7a
commit
9d4ced1237
@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- wait_for - Read file and perform comparisons using bytes to avoid decode errors
|
||||
(https://github.com/ansible/ansible/issues/78214)
|
@ -0,0 +1,20 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import sys
|
||||
|
||||
# utf16 encoded bytes
|
||||
# to ensure wait_for doesn't have any encoding errors
|
||||
data = (
|
||||
b'\xff\xfep\x00r\x00e\x00m\x00i\x00\xe8\x00r\x00e\x00 \x00i\x00s\x00 '
|
||||
b'\x00f\x00i\x00r\x00s\x00t\x00\n\x00p\x00r\x00e\x00m\x00i\x00e\x00'
|
||||
b'\x00\x03r\x00e\x00 \x00i\x00s\x00 \x00s\x00l\x00i\x00g\x00h\x00t\x00'
|
||||
b'l\x00y\x00 \x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00t\x00\n\x00\x1a'
|
||||
b'\x048\x04@\x048\x04;\x04;\x048\x04F\x040\x04 \x00i\x00s\x00 \x00C\x00y'
|
||||
b'\x00r\x00i\x00l\x00l\x00i\x00c\x00\n\x00\x01\xd8\x00\xdc \x00a\x00m'
|
||||
b'\x00 \x00D\x00e\x00s\x00e\x00r\x00e\x00t\x00\n\x00\n'
|
||||
b'completed\n'
|
||||
)
|
||||
|
||||
with open(sys.argv[1], 'wb') as f:
|
||||
f.write(data)
|
Loading…
Reference in New Issue