commit 0ea40c4049f9dc8daba783a13a08d584660a7091
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Mon Mar 3 16:00:37 2014 +0100
NetTestSlave: resource_table init
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>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NetTestSlave.py | 4 ++--
1 files 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):
Show replies by date