Python 3 support

This commit is contained in:
Graham Clinch 2018-03-02 16:38:08 +00:00
parent 7731ffae20
commit d59fd8ff62

View File

@ -12,6 +12,7 @@ import re
# Import salt libs
import salt.utils.path
import salt.utils.files
import salt.utils.stringutils
import salt.utils.versions
log = logging.getLogger(__name__)
@ -128,7 +129,7 @@ def set_(package, question, type, value, *extra):
fd_, fname = salt.utils.files.mkstemp(prefix="salt-", close_fd=False)
line = "{0} {1} {2} {3}".format(package, question, type, value)
os.write(fd_, line)
os.write(fd_, salt.utils.stringutils.to_bytes(line))
os.close(fd_)
_set_file(fname)