From 593d0f17ae026fb6294c54cd4d66803d9226231c Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 8 Jan 2016 09:57:15 +0100 Subject: [PATCH] bugfix - filter_existing_files and changing loop subject --- nepi/resources/linux/node.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 - -- 2.43.0