Merge pull request #44973 from gtmanfred/oxygen

fix proxyminion tests with py3
This commit is contained in:
Nicole Thomas 2017-12-14 12:53:22 -05:00 committed by GitHub
commit 3ed7a29c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,10 +9,8 @@ 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.files
# This must be present or the Salt loader won't load this module
@ -47,7 +45,12 @@ def _save_state(details):
def _load_state():
try:
with salt.utils.files.fopen(FILENAME, 'r') as pck:
if six.PY3 is True:
mode = 'rb'
else:
mode = 'r'
with salt.utils.files.fopen(FILENAME, mode) as pck:
DETAILS = pickle.load(pck)
except EOFError:
DETAILS = {}
@ -136,7 +139,7 @@ def service_list():
List "services" on the REST server
'''
DETAILS = _load_state()
return DETAILS['services'].keys()
return list(DETAILS['services'])
def service_status(name):