Py3 compatibility

This commit is contained in:
Pedro Algarvio 2015-01-21 01:44:38 +00:00
parent da7fefaea6
commit fb9166e977

View File

@ -17,6 +17,8 @@ opts['ioflo_realtime']
opts['ioflo_verbose']
opts['caller_floscript']
'''
# Import Python libs
from __future__ import absolute_import
import os
@ -30,8 +32,9 @@ __all__ = ['core', 'worker', 'maint']
# Import salt libs
import salt.daemons.masterapi
# Import ioflo libs
# Import 3rd-party libs
import ioflo.app.run
import salt.ext.six as six
def explode_opts(opts):
@ -39,9 +42,9 @@ def explode_opts(opts):
Explode the opts into a preloads list
'''
preloads = [('.salt.opts', dict(value=opts))]
#for key, val in opts.items():
#ukey = key.replace('.', '_')
#preloads.append(('.salt.etc.{0}'.format(ukey), dict(value=val)))
for key, val in six.iteritems(opts):
ukey = key.replace('.', '_')
preloads.append(('.salt.etc.{0}'.format(ukey), dict(value=val)))
preloads.append(('.salt.etc.id', dict(value=opts['id'])))
return preloads