diff --git a/tests/base.py b/tests/base.py
index 1278c94..5a8fc36 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -2288,7 +2288,7 @@
 
     def countJobResults(self, jobs, result):
         jobs = filter(lambda x: x.result == result, jobs)
-        return len(jobs)
+        return len(list(jobs))
 
     def getJobFromHistory(self, name, project=None):
         for job in self.history:
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index bc827b3..61e9683 100755
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -3339,7 +3339,7 @@
             if time.time() - start > 10:
                 raise Exception("Timeout waiting for gearman server to report "
                                 + "back to the client")
-            build = self.executor.builds.values()[0]
+            build = list(self.executor.builds.values())[0]
             if build.worker.name == "My Worker":
                 break
             else:
@@ -3512,7 +3512,7 @@
             if time.time() - start > 10:
                 raise Exception("Timeout waiting for gearman server to report "
                                 + "back to the client")
-            build = self.executor_client.builds.values()[0]
+            build = list(self.executor_client.builds.values())[0]
             if build.worker.name == "My Worker":
                 break
             else:
diff --git a/zuul/configloader.py b/zuul/configloader.py
index 070e731..b23846d 100644
--- a/zuul/configloader.py
+++ b/zuul/configloader.py
@@ -111,7 +111,7 @@
         r = super(ZuulSafeLoader, self).construct_mapping(node, deep)
         keys = frozenset(r.keys())
         if len(keys) == 1 and keys.intersection(self.zuul_node_types):
-            d = r.values()[0]
+            d = list(r.values())[0]
             if isinstance(d, dict):
                 d['_start_mark'] = node.start_mark
                 d['_source_context'] = self.zuul_context
@@ -493,7 +493,7 @@
                 attrs = dict(name=conf_job)
             elif isinstance(conf_job, dict):
                 # A dictionary in a job tree may override params
-                jobname, attrs = conf_job.items()[0]
+                jobname, attrs = list(conf_job.items())[0]
                 if attrs:
                     # We are overriding params, so make a new job def
                     attrs['name'] = jobname
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index dfa5a2b..ce156de 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -369,7 +369,7 @@
         self.command_socket.stop()
         self.update_queue.put(None)
 
-        for job_worker in self.job_workers.values():
+        for job_worker in list(self.job_workers.values()):
             try:
                 job_worker.stop()
             except Exception:
diff --git a/zuul/manager/__init__.py b/zuul/manager/__init__.py
index bdfde48..5b32e5b 100644
--- a/zuul/manager/__init__.py
+++ b/zuul/manager/__init__.py
@@ -426,7 +426,7 @@
             build.result = 'CANCELED'
             canceled = True
             canceled_jobs.add(build.job.name)
-        for jobname, nodeset in old_build_set.nodesets.items()[:]:
+        for jobname, nodeset in list(old_build_set.nodesets.items()):
             if jobname in canceled_jobs:
                 continue
             self.sched.nodepool.returnNodeSet(nodeset)
diff --git a/zuul/model.py b/zuul/model.py
index f7ae68d..833c673 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -1207,7 +1207,7 @@
         return self.builds.get(job_name)
 
     def getBuilds(self):
-        keys = self.builds.keys()
+        keys = list(self.builds.keys())
         keys.sort()
         return [self.builds.get(x) for x in keys]
 
@@ -2333,7 +2333,7 @@
                 raise Exception("Configuration item dictionaries must have "
                                 "a single key (when parsing %s)" %
                                 (conf,))
-            key, value = item.items()[0]
+            key, value = list(item.items())[0]
             if key == 'tenant':
                 self.tenants.append(value)
             else:
@@ -2391,7 +2391,7 @@
                 raise Exception("Configuration item dictionaries must have "
                                 "a single key (when parsing %s)" %
                                 (conf,))
-            key, value = item.items()[0]
+            key, value = list(item.items())[0]
             if key == 'project':
                 name = value['name']
                 self.projects.setdefault(name, []).append(value)
@@ -2698,7 +2698,7 @@
             if hostname:
                 project = hostname_dict.get(hostname)
             else:
-                values = hostname_dict.values()
+                values = list(hostname_dict.values())
                 if len(values) == 1:
                     project = values[0]
                 else:
diff --git a/zuul/zk.py b/zuul/zk.py
index 5cd7bee..a7616a4 100644
--- a/zuul/zk.py
+++ b/zuul/zk.py
@@ -168,7 +168,7 @@
             if data:
                 data = self._strToDict(data)
                 node_request.updateFromDict(data)
-                request_nodes = node_request.nodeset.getNodes()
+                request_nodes = list(node_request.nodeset.getNodes())
                 for i, nodeid in enumerate(data.get('nodes', [])):
                     node_path = '%s/%s' % (self.NODE_ROOT, nodeid)
                     node_data, node_stat = self.client.get(node_path)
