bugfix - filter_existing_files and changing loop subject
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 8 Jan 2016 08:57:15 +0000 (09:57 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 8 Jan 2016 08:57:15 +0000 (09:57 +0100)
nepi/resources/linux/node.py

index 375ff3a..56cc715 100644 (file)
@@ -1189,7 +1189,10 @@ class LinuxNode(ResourceManager):
 
         (out, err), proc = self.execute(command, retry = 1, with_lock = True)
         
-        for d in dests:
+        # avoid RuntimeError that would result from
+        # changing loop subject during iteration
+        keys = list(dests.keys())
+        for d in keys:
             if out.find(d) > -1:
                 del dests[d]
 
@@ -1199,4 +1202,3 @@ class LinuxNode(ResourceManager):
         retcod = dests.values()
         if PY3: retcod = list(retcod)
         return retcod
-