diff --git a/ceilometer/objectstore/swift_middleware.py b/ceilometer/objectstore/swift_middleware.py index a630bf28a..751b06873 100644 --- a/ceilometer/objectstore/swift_middleware.py +++ b/ceilometer/objectstore/swift_middleware.py @@ -96,9 +96,9 @@ class CeilometerMiddleware(object): def iter_response(iterable): iterator = iter(iterable) try: - chunk = iterator.next() + chunk = next(iterator) while not chunk: - chunk = iterator.next() + chunk = next(iterator) except StopIteration: chunk = '' @@ -109,7 +109,7 @@ class CeilometerMiddleware(object): while chunk: bytes_sent += len(chunk) yield chunk - chunk = iterator.next() + chunk = next(iterator) finally: try: self.publish_sample(env, diff --git a/ceilometer/tests/compute/pollsters/test_cpu.py b/ceilometer/tests/compute/pollsters/test_cpu.py index 783276c05..c95321bec 100644 --- a/ceilometer/tests/compute/pollsters/test_cpu.py +++ b/ceilometer/tests/compute/pollsters/test_cpu.py @@ -20,7 +20,6 @@ import time import mock -import six from ceilometer.compute import manager from ceilometer.compute.pollsters import cpu @@ -43,7 +42,7 @@ class TestCPUPollster(base.TestPollsterBase): )) def inspect_cpus(name): - return six.next(next_value) + return next(next_value) self.inspector.inspect_cpus = mock.Mock(side_effect=inspect_cpus) @@ -92,7 +91,7 @@ class TestCPUUtilPollster(base.TestPollsterBase): )) def inspect_cpu_util(name, duration): - return six.next(next_value) + return next(next_value) self.inspector.inspect_cpu_util = (mock. Mock(side_effect=inspect_cpu_util)) diff --git a/ceilometer/tests/compute/pollsters/test_memory.py b/ceilometer/tests/compute/pollsters/test_memory.py index f1c805a97..969518eb8 100644 --- a/ceilometer/tests/compute/pollsters/test_memory.py +++ b/ceilometer/tests/compute/pollsters/test_memory.py @@ -14,7 +14,6 @@ # under the License. import mock -import six from ceilometer.compute import manager from ceilometer.compute.pollsters import memory @@ -35,7 +34,7 @@ class TestMemoryPollster(base.TestPollsterBase): )) def inspect_memory_usage(instance, duration): - return six.next(next_value) + return next(next_value) (self.inspector. inspect_memory_usage) = mock.Mock(side_effect=inspect_memory_usage) diff --git a/ceilometer/tests/profiler/test_notifications.py b/ceilometer/tests/profiler/test_notifications.py index 943f71b19..e923b0536 100644 --- a/ceilometer/tests/profiler/test_notifications.py +++ b/ceilometer/tests/profiler/test_notifications.py @@ -43,7 +43,7 @@ class ProfilerNotificationsTestCase(test.BaseTestCase): def test_process_notification(self): prof = notifications.ProfilerNotifications(None) - info = prof.process_notification(NOTIFICATION).next() + info = next(prof.process_notification(NOTIFICATION)) self.assertEqual(NOTIFICATION["payload"]["name"], info.name) self.assertEqual(sample.TYPE_GAUGE, info.type)