Py3 compatibility fixes.

This commit is contained in:
Pedro Algarvio 2014-11-23 23:41:37 +00:00
parent e4467f59e2
commit 47412fc10e

View File

@ -2,9 +2,9 @@
''' '''
Minion side functions for salt-cp Minion side functions for salt-cp
''' '''
from __future__ import absolute_import
# Import python libs # Import python libs
from __future__ import absolute_import
import os import os
import logging import logging
import fnmatch import fnmatch
@ -17,6 +17,9 @@ import salt.crypt
import salt.transport import salt.transport
from salt.exceptions import CommandExecutionError from salt.exceptions import CommandExecutionError
# Import 3rd-party libs
import salt.ext.six as six
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -37,7 +40,7 @@ def recv(files, dest):
It does not work via the CLI. It does not work via the CLI.
''' '''
ret = {} ret = {}
for path, data in files.items(): for path, data in six.iteritems(files):
if os.path.basename(path) == os.path.basename(dest) \ if os.path.basename(path) == os.path.basename(dest) \
and not os.path.isdir(dest): and not os.path.isdir(dest):
final = dest final = dest