From: Ondrej Lichtner <olichtne(a)redhat.com>
When the resource_table is initialized or cleared it should have at
least empty 'module' and 'tools' subdictionaries created. This is so
that proper exceptions are raised in case nothing was synchronized to
the slave - before this commit an exception KeyError 'module not
defined' would be raised, instead an exception "module/tool xyz not
found" is more appropriate.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Slave/NetTestSlave.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 28c595e..dca0a59 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -58,7 +58,7 @@ class SlaveMethods:
self._cache = ResourceCache(lnst_config.get_option("cache",
"dir"),
lnst_config.get_option("cache",
"expiration_period"))
- self._resource_table = {}
+ self._resource_table = {'module': {}, 'tools': {}}
def hello(self, recipe_path):
self.machine_cleanup()
@@ -261,7 +261,7 @@ class SlaveMethods:
return True
def clear_resource_table(self):
- self._resource_table = {}
+ self._resource_table = {'module': {}, 'tools': {}}
return True
def has_resource(self, res_hash):
--
1.8.5.3