mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix starting proxy minion on py3
This commit is contained in:
parent
e2824a7253
commit
8736e21f65
1 changed files with 10 additions and 5 deletions
|
@ -9,8 +9,9 @@ import os
|
|||
import pickle
|
||||
import logging
|
||||
|
||||
# Import Salt modules
|
||||
import salt.utils.files
|
||||
# Import Salt libs
|
||||
import salt.ext.six as six
|
||||
import salt.utils
|
||||
|
||||
# This must be present or the Salt loader won't load this module
|
||||
__proxyenabled__ = ['dummy']
|
||||
|
@ -45,9 +46,13 @@ def _save_state(details):
|
|||
|
||||
def _load_state():
|
||||
try:
|
||||
pck = open(FILENAME, 'r') # pylint: disable=W8470
|
||||
DETAILS = pickle.load(pck)
|
||||
pck.close()
|
||||
if six.PY3 is True:
|
||||
mode = 'rb'
|
||||
else:
|
||||
mode = 'r'
|
||||
|
||||
with salt.utils.fopen(FILENAME, mode) as pck:
|
||||
DETAILS = pickle.load(pck)
|
||||
except EOFError:
|
||||
DETAILS = {}
|
||||
DETAILS['initialized'] = False
|
||||
|
|
Loading…
Add table
Reference in a new issue