Py3 compatibility fixes

This commit is contained in:
Pedro Algarvio 2014-11-21 22:29:21 +00:00
parent 45bac633af
commit 7f443f953b

View File

@ -2,14 +2,17 @@
''' '''
Read in files from the file_root and save files to the file root Read in files from the file_root and save files to the file root
''' '''
from __future__ import absolute_import
# Import python libs # Import python libs
from __future__ import absolute_import
import os import os
# Import salt libs # Import salt libs
import salt.utils import salt.utils
# Import 3rd-party libs
import salt.ext.six as six
def find(path, saltenv='base', env=None): def find(path, saltenv='base', env=None):
''' '''
@ -107,7 +110,7 @@ def read(path, saltenv='base', env=None):
ret = [] ret = []
files = find(path, saltenv) files = find(path, saltenv)
for fn_ in files: for fn_ in files:
full = next(fn_.iterkeys()) full = next(six.iterkeys(fn_))
form = fn_[full] form = fn_[full]
if form == 'txt': if form == 'txt':
with salt.utils.fopen(full, 'rb') as fp_: with salt.utils.fopen(full, 'rb') as fp_: