Skip to content

Commit fe56382

Browse files
committed
feat: python2 -> python3
1 parent 52abf46 commit fe56382

File tree

10 files changed

+133
-124
lines changed

10 files changed

+133
-124
lines changed

lib/diff.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import re
21
import sys
32

43

@@ -61,10 +60,6 @@ def _print(color, msg, output):
6160

6261

6362
def compare_states(before, after, logging, output=sys.stdout, limit=10000):
64-
# Did we detect _any_ changes?
65-
changed = False
66-
67-
# Any new tables?
6863
tables_before = set(before['tables'])
6964
tables_after = set(after['tables'])
7065
dropped_tables = tables_before - tables_after
@@ -73,12 +68,10 @@ def compare_states(before, after, logging, output=sys.stdout, limit=10000):
7368
output.write('Dropped %d table(s):' % (len(dropped_tables)))
7469
for dropped_table in dropped_tables:
7570
_print(bcolors.FAIL, dropped_table, output)
76-
changed = True
7771
if len(new_tables) > 0:
7872
output.write('Added %d table(s):' % (len(new_tables)))
7973
for added_table in new_tables:
8074
_print(bcolors.OKGREEN, added_table, output)
81-
changed = True
8275

8376
# We can only do diff magic on tables that were in both databases
8477
tables = tables_after.intersection(tables_before)
@@ -93,7 +86,6 @@ def compare_states(before, after, logging, output=sys.stdout, limit=10000):
9386
delta_count = count_after - count_before
9487
if delta_count != 0:
9588
logging.info('%s %d' % (table, delta_count))
96-
changed = True
9789
removed_objects = objects_before - objects_after
9890
added_objects = objects_after - objects_before
9991
if len(removed_objects) > 0:

lib/firewall.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def prefetch_node_and_services(self):
7777

7878
self.node_services = dict()
7979
self.service_nodes = dict()
80-
for access, access_key in access_to_sql_map.iteritems():
80+
for access, access_key in access_to_sql_map.items():
8181
# TODO(bluecmd): These are deprecated in favor of packages
8282
# We should emit warnings in the presubmit hook to make sure
8383
# people are not using these
@@ -90,14 +90,14 @@ def prefetch_node_and_services(self):
9090
for node, service in explicit:
9191
self.register_service(access, node, service)
9292

93-
for node, packset in self.nodes.iteritems():
93+
for node, packset in self.nodes.items():
9494
for package_name in packset:
9595
package = self.packages[package_name] or {}
9696
for service in set(package.get(access, [])):
9797
self.register_service(access, node, service)
9898

9999
# Prune redundant flows (hosts that share the network flows)
100-
for node, services in self.node_services[access].iteritems():
100+
for node in self.node_services[access].iteritems():
101101
if node not in self.netmap:
102102
continue
103103
parent = self.node_services[access].get(self.netmap[node])

0 commit comments

Comments
 (0)