From b305115b190fa61dc5a56167045a2e702ab90af7 Mon Sep 17 00:00:00 2001 From: David Boucha Date: Fri, 7 Feb 2014 14:44:54 -0700 Subject: [PATCH] read/write binary w/msgpack --- salt/auth/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index affd79c59429..f2fffbfd54a1 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -118,7 +118,7 @@ def mk_token(self, load): 'name': fcall['args'][0], 'eauth': load['eauth'], 'token': tok} - with salt.utils.fopen(t_path, 'w+') as fp_: + with salt.utils.fopen(t_path, 'w+b') as fp_: fp_.write(self.serial.dumps(tdata)) return tdata @@ -130,7 +130,7 @@ def get_tok(self, tok): t_path = os.path.join(self.opts['token_dir'], tok) if not os.path.isfile(t_path): return {} - with salt.utils.fopen(t_path, 'r') as fp_: + with salt.utils.fopen(t_path, 'rb') as fp_: tdata = self.serial.loads(fp_.read()) rm_tok = False if 'expire' not in tdata: