Skip to content

Commit

Permalink
read/write binary w/msgpack
Browse files Browse the repository at this point in the history
  • Loading branch information
UtahDave authored and basepi committed Feb 13, 2014
1 parent 90f7dba commit b305115
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salt/auth/__init__.py
Expand Up @@ -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

Expand All @@ -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:
Expand Down

0 comments on commit b305115

Please sign in to comment.