|
@@ -222,7 +222,7 @@ class LeObject(object):
|
222
|
222
|
raise SettingsError(expt_msg)
|
223
|
223
|
try:
|
224
|
224
|
#fetching plugin name
|
225
|
|
- ds_plugin_name, ds_name = cls._get_ds_plugin_name(ds_name, ro)
|
|
225
|
+ ds_plugin_name, ds_identifier = cls._get_ds_plugin_name(ds_name, ro)
|
226
|
226
|
except NameError:
|
227
|
227
|
expt_msg += "Datasource %s is missconfigured, missing identifier."
|
228
|
228
|
expt_msg %= ds_name
|
|
@@ -237,7 +237,7 @@ a read only as a read&write datasource"
|
237
|
237
|
raise SettingsError(expt_msg)
|
238
|
238
|
|
239
|
239
|
try:
|
240
|
|
- ds_conf = cls._get_ds_connection_conf(ds_name, ds_plugin_name)
|
|
240
|
+ ds_conf = cls._get_ds_connection_conf(ds_identifier, ds_plugin_name)
|
241
|
241
|
except NameError as e:
|
242
|
242
|
expt_msg += str(e)
|
243
|
243
|
raise SettingsError(expt_msg)
|
|
@@ -254,22 +254,22 @@ raised when trying to import Datasource"
|
254
|
254
|
return datasource_class(**ds_conf)
|
255
|
255
|
|
256
|
256
|
##@brief Try to fetch a datasource configuration
|
257
|
|
- #@param ds_name str : datasource name
|
|
257
|
+ #@param ds_identifier str : datasource name
|
258
|
258
|
#@param ds_plugin_name : datasource plugin name
|
259
|
259
|
#@return a dict containing datasource initialisation options
|
260
|
260
|
#@throw NameError if a datasource plugin or instance cannot be found
|
261
|
261
|
@staticmethod
|
262
|
|
- def _get_ds_connection_conf(ds_name,ds_plugin_name):
|
|
262
|
+ def _get_ds_connection_conf(ds_identifier,ds_plugin_name):
|
263
|
263
|
if ds_plugin_name not in Settings.datasource._fields:
|
264
|
264
|
msg = "Unknown or unconfigured datasource plugin %s"
|
265
|
265
|
msg %= ds_plugin
|
266
|
266
|
raise NameError(msg)
|
267
|
267
|
ds_conf = getattr(Settings.datasource, ds_plugin_name)
|
268
|
|
- if ds_name not in ds_conf._fields:
|
|
268
|
+ if ds_identifier not in ds_conf._fields:
|
269
|
269
|
msg = "Unknown or unconfigured datasource instance %s"
|
270
|
270
|
msg %= ds_identifier
|
271
|
271
|
raise NameError(msg)
|
272
|
|
- ds_conf = getattr(ds_conf, ds_name)
|
|
272
|
+ ds_conf = getattr(ds_conf, ds_identifier)
|
273
|
273
|
return {k: getattr(ds_conf,k) for k in ds_conf._fields }
|
274
|
274
|
|
275
|
275
|
##@brief fetch datasource plugin name
|