Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add resolver method for generating token

  • Loading branch information...
commit 3f36c901b928a4a2b9fd6756fb6824fd8a45890e 1 parent a3774b8
@thatch45 thatch45 authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 salt/auth/__init__.py
View
8 salt/auth/__init__.py
@@ -151,6 +151,7 @@ class Resolver(object):
def __init__(self, opts):
self.opts = opts
self.auth = salt.loader.auth(opts)
+ self.serial = salt.payload.Serial(opts)
def cli(self, eauth):
'''
@@ -190,4 +191,9 @@ def token_cli(self, eauth):
'''
load = self.cli(eauth)
tdata = self.auth.mktoken(load)
-
+ try:
+ with open(self.opts['token_file'], 'w+') as fp_:
+ fp_.write(self.serial.dumps(tdata))
+ except (IOError, OSError):
+ pass
+ return tdata
Please sign in to comment.
Something went wrong with that request. Please try again.