Merge remote-tracking branch 'origin/master' into merge-branch

Change-Id: Ib8c70c6aec4e320c84546c8ab52e29b97c62d401
diff --git a/neutron/tests/tempest/common/accounts.py b/neutron/tests/tempest/common/accounts.py
index 1fcef11..1a50e3c 100644
--- a/neutron/tests/tempest/common/accounts.py
+++ b/neutron/tests/tempest/common/accounts.py
@@ -271,7 +271,7 @@
                 return getattr(user, cred_arg) != getattr(alt_user, cred_arg)
             except exceptions.InvalidCredentials as ic:
                 msg = "At least one of the configured credentials is " \
-                      "not valid: %s" % ic.message
+                      "not valid: %s" % ic
                 raise exceptions.InvalidConfiguration(msg)
         else:
             # TODO(andreaf) Add a uniqueness check here
diff --git a/neutron/tests/tempest/common/custom_matchers.py b/neutron/tests/tempest/common/custom_matchers.py
index 298a94e..839088c 100644
--- a/neutron/tests/tempest/common/custom_matchers.py
+++ b/neutron/tests/tempest/common/custom_matchers.py
@@ -14,6 +14,7 @@
 
 import re
 
+import six
 from testtools import helpers
 
 
@@ -121,7 +122,7 @@
     """
 
     def match(self, actual):
-        for key, value in actual.iteritems():
+        for key, value in six.iteritems(actual):
             if key in ('content-length', 'x-account-bytes-used',
                        'x-account-container-count', 'x-account-object-count',
                        'x-container-bytes-used', 'x-container-object-count')\
diff --git a/neutron/tests/tempest/common/generator/base_generator.py b/neutron/tests/tempest/common/generator/base_generator.py
index f81f405..5ac927c 100644
--- a/neutron/tests/tempest/common/generator/base_generator.py
+++ b/neutron/tests/tempest/common/generator/base_generator.py
@@ -17,6 +17,7 @@
 import functools
 
 import jsonschema
+import six
 
 from oslo_log import log as logging
 
@@ -122,7 +123,7 @@
 
         if schema_type == 'object':
             properties = schema["properties"]
-            for attribute, definition in properties.iteritems():
+            for attribute, definition in six.iteritems(properties):
                 current_path = copy.copy(path)
                 if path is not None:
                     current_path.append(attribute)
diff --git a/neutron/tests/tempest/common/generator/valid_generator.py b/neutron/tests/tempest/common/generator/valid_generator.py
index 8ff9259..2698200 100644
--- a/neutron/tests/tempest/common/generator/valid_generator.py
+++ b/neutron/tests/tempest/common/generator/valid_generator.py
@@ -14,6 +14,7 @@
 #    under the License.
 
 from oslo_log import log as logging
+import six
 
 import neutron.tests.tempest.common.generator.base_generator as base
 
@@ -51,7 +52,7 @@
     @base.simple_generator
     def generate_valid_object(self, schema):
         obj = {}
-        for k, v in schema["properties"].iteritems():
+        for k, v in six.iteritems(schema["properties"]):
             obj[k] = self.generate_valid(v)
         return obj
 
diff --git a/neutron/tests/tempest/common/glance_http.py b/neutron/tests/tempest/common/glance_http.py
index 6cdbadc..0a6f985 100644
--- a/neutron/tests/tempest/common/glance_http.py
+++ b/neutron/tests/tempest/common/glance_http.py
@@ -367,7 +367,7 @@
 
     def __iter__(self):
         while True:
-            yield self.next()
+            yield next(self)
 
     def next(self):
         chunk = self.resp.read(CHUNKSIZE)
@@ -375,3 +375,5 @@
             return chunk
         else:
             raise StopIteration()
+
+    __next__ = next
diff --git a/neutron/tests/tempest/common/isolated_creds.py b/neutron/tests/tempest/common/isolated_creds.py
index b4de93b..5da24a9 100644
--- a/neutron/tests/tempest/common/isolated_creds.py
+++ b/neutron/tests/tempest/common/isolated_creds.py
@@ -369,7 +369,7 @@
         if not self.isolated_creds:
             return
         self._clear_isolated_net_resources()
-        for creds in self.isolated_creds.itervalues():
+        for creds in self.isolated_creds.values():
             try:
                 self._delete_user(creds.user_id)
             except lib_exc.NotFound: