[oe-commits] Stefan Stanacar : oeqa/targetcontrol: fix loading a controller using a class name

git at git.openembedded.org git at git.openembedded.org
Tue Mar 11 15:15:09 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 47d2049d13ab71e0310e9eedaf307d6c3e530b44
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=47d2049d13ab71e0310e9eedaf307d6c3e530b44

Author: Stefan Stanacar <stefanx.stanacar at intel.com>
Date:   Fri Mar  7 11:34:05 2014 +0000

oeqa/targetcontrol: fix loading a controller using a class name

This was wrong and if one would do TEST_TARGET = "SimpleRemoteTarget"
instead of TEST_TARGET = "simpleremote" it would complain
that there is no such controller when there is.

Signed-off-by: Stefan Stanacar <stefanx.stanacar at intel.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oeqa/targetcontrol.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 17871f5..873a664 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -9,6 +9,7 @@ import shutil
 import subprocess
 import bb
 import traceback
+import sys
 from oeqa.utils.sshcontrol import SSHControl
 from oeqa.utils.qemurunner import QemuRunner
 from oeqa.controllers.testtargetloader import TestTargetLoader
@@ -25,7 +26,7 @@ def get_target_controller(d):
         # use the class name
         try:
             # is it a core class defined here?
-            controller = getattr(__name__, testtarget)
+            controller = getattr(sys.modules[__name__], testtarget)
         except AttributeError:
             # nope, perhaps a layer defined one
             try:



More information about the Openembedded-commits mailing list