PktgenTx test module code made Python ast module crashing.
This was due to unhandled case while walking the code tree.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Common/Utils.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index d7dcda3..19ac898 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -182,6 +182,8 @@ def get_module_tools(module_path):
fn = getattr(node, 'func')
if isinstance(fn, Attribute):
val = getattr(fn, 'value')
+ if not isinstance(val, ast.Name):
+ continue
if ('self' == getattr(val, 'id')):
if ( 'exec_from' == getattr(fn, 'attr')):
tool = getattr((getattr(node, 'args')[0]), 's')
--
1.9.3
Show replies by thread