Fixing import of sync_step from the same folder
Change-Id: I4811fe4a52759d0bbe90cb2b9ee32c7002984fb4
diff --git a/xos/synchronizers/new_base/backend.py b/xos/synchronizers/new_base/backend.py
index 32de955..24e7492 100644
--- a/xos/synchronizers/new_base/backend.py
+++ b/xos/synchronizers/new_base/backend.py
@@ -69,7 +69,13 @@
for fn in os.listdir(step_dir):
pathname = os.path.join(step_dir,fn)
if os.path.isfile(pathname) and fn.endswith(".py") and (fn!="__init__.py") and not "test" in fn:
+
+ # we need to extend the path to load modules in the step_dir
+ sys_path_save = sys.path
+ sys.path.append(step_dir)
module = imp.load_source(fn[:-3],pathname)
+ # reset the original path
+ sys.path = sys_path_save
for classname in dir(module):
c = getattr(module, classname, None)