mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #44973 from gtmanfred/oxygen
fix proxyminion tests with py3
This commit is contained in:
commit
3ed7a29c56
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user