Py3 compatibility fixes.

This commit is contained in:
Pedro Algarvio 2014-11-22 14:29:01 +00:00
parent 7c81f6df70
commit cb4aa40516

View File

@ -45,12 +45,16 @@ If you want to run reclass from source, rather than installing it, you can
either let the master know via the ``PYTHONPATH`` environment variable, or by
setting the configuration option, like in the example above.
'''
from __future__ import absolute_import
# This file cannot be called reclass.py, because then the module import would
# not work. Thanks to the __virtual__ function, however, the plugin still
# responds to the name 'reclass'.
# Import python libs
from __future__ import absolute_import
# Import salt libs
from salt.exceptions import SaltInvocationError
from salt.utils.reclass import (
prepend_reclass_source_path,
@ -58,6 +62,9 @@ from salt.utils.reclass import (
set_inventory_base_uri_default
)
# Import 3rd-party libs
import salt.ext.six as six
# Define the module's virtual name
__virtualname__ = 'reclass'
@ -76,7 +83,7 @@ def __virtual__(retry=False):
continue
# each pillar entry is a single-key hash of name -> options
opts = next(pillar.itervalues())
opts = next(six.itervalues(pillar))
prepend_reclass_source_path(opts)
break