Commit 1e2dba15 authored by Mike Hibler's avatar Mike Hibler

mikes first python: don't remove items from the list we are iterating

parent 5471f18e
......@@ -729,11 +729,13 @@ class Plab:
# Enforce allowed nodes limitation, if any.
if len(ALLOWED_NODES):
ravail = []
for ip in avail:
if ip not in ALLOWED_NODES:
avail.remove(ip)
print "Advertisements in allowed nodes list:\n%s" % avail
if ip in ALLOWED_NODES:
ravail.append(ip)
print "Advertisements in allowed nodes list:\n%s" % ravail
avail = ravail
known = self.__getKnownPnodes()
if debug:
print "Got known pnodes:"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment