|
@@ -223,12 +223,18 @@ class LeObject(object):
|
223
|
223
|
#Checks that the datasource plugin exists
|
224
|
224
|
ds_plugin_module = Plugins.plugin_module(ds_plugin)
|
225
|
225
|
try:
|
226
|
|
- cls._datasource = getattr(ds_plugin_module, "Datasource")
|
|
226
|
+ datasource_class = getattr(ds_plugin_module, "Datasource")
|
227
|
227
|
except AttributeError as e:
|
228
|
228
|
raise e
|
229
|
229
|
expt_msg += "The datasource plugin %s seems to be invalid. Error raised when trying to import Datasource"
|
230
|
230
|
expt_msg %= ds_identifier
|
231
|
231
|
raise SettingsError(expt_msg)
|
|
232
|
+ ds_conf_old = ds_conf
|
|
233
|
+ ds_conf = dict()
|
|
234
|
+ for k in ds_conf_old._fields:
|
|
235
|
+ ds_conf[k] = getattr(ds_conf_old, k)
|
|
236
|
+
|
|
237
|
+ cls._datasource = datasource_class(**ds_conf)
|
232
|
238
|
log_msg = "Datasource %s initialized for LeObject %s"
|
233
|
239
|
log_msg %= (datasource_orig_name, cls.__name__)
|
234
|
240
|
logger.debug(log_msg)
|