Py3 compatibility fixes

This commit is contained in:
Pedro Algarvio 2014-11-21 20:32:35 +00:00
parent f3bc5bdb49
commit 309876eac1

View File

@ -35,6 +35,7 @@ except ImportError:
class AsyncHTTPTestCase(object):
pass
import salt.ext.six as six
from salt.ext.six.moves.urllib.parse import urlencode # pylint: disable=no-name-in-module
# pylint: enable=import-error
@ -259,7 +260,7 @@ class TestSaltAuthHandler(SaltnadoTestCase):
Test logins with bad/missing passwords
'''
bad_creds = []
for key, val in self.auth_creds_dict.iteritems():
for key, val in six.iteritems(self.auth_creds_dict):
if key == 'password':
continue
bad_creds.append((key, val))
@ -275,7 +276,7 @@ class TestSaltAuthHandler(SaltnadoTestCase):
Test logins with bad/missing passwords
'''
bad_creds = []
for key, val in self.auth_creds_dict.iteritems():
for key, val in six.iteritems(self.auth_creds_dict):
if key == 'username':
val = val + 'foo'
bad_creds.append((key, val))