From: Thierry Parmentelat Date: Fri, 8 Jan 2016 08:57:15 +0000 (+0100) Subject: bugfix - filter_existing_files and changing loop subject X-Git-Tag: nepi-6.0.4-pypi~1 X-Git-Url: http://git.onelab.eu/?p=nepi.git;a=commitdiff_plain;h=593d0f17ae026fb6294c54cd4d66803d9226231c bugfix - filter_existing_files and changing loop subject --- diff --git a/nepi/resources/linux/node.py b/nepi/resources/linux/node.py index 375ff3a6..56cc7152 100644 --- a/nepi/resources/linux/node.py +++ b/nepi/resources/linux/node.py @@ -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 -