@@ -37,10 +37,10 @@ def load_backends(config, callback, internal_attributes):
37
37
:return: A list of backend modules
38
38
"""
39
39
return _load_endpoint_modules (
40
- _load_plugins (config .PLUGIN_PATH , config .BACKEND_MODULES , backend_filter ,
41
- BackendModulePlugin .__name__ ,
42
- config .BASE ),
43
- callback , internal_attributes )
40
+ _load_plugins (config .PLUGIN_PATH , config .BACKEND_MODULES , backend_filter ,
41
+ BackendModulePlugin .__name__ ,
42
+ config .BASE ),
43
+ callback , internal_attributes )
44
44
45
45
46
46
def load_frontends (config , callback , internal_attributes ):
@@ -59,10 +59,10 @@ def load_frontends(config, callback, internal_attributes):
59
59
:return: A dict of frontend modules
60
60
"""
61
61
return _load_endpoint_modules (
62
- _load_plugins (config .PLUGIN_PATH , config .FRONTEND_MODULES , frontend_filter ,
63
- FrontendModulePlugin .__name__ ,
64
- config .BASE ),
65
- callback , internal_attributes )
62
+ _load_plugins (config .PLUGIN_PATH , config .FRONTEND_MODULES , frontend_filter ,
63
+ FrontendModulePlugin .__name__ ,
64
+ config .BASE ),
65
+ callback , internal_attributes )
66
66
67
67
68
68
def _member_filter (member ):
@@ -213,7 +213,7 @@ def _load_json(config):
213
213
if file_config is not None and os .path .isfile (file_config ):
214
214
LOGGER .exception ("The configuration file %s is corrupt." % file_config )
215
215
raise SATOSAConfigurationError (
216
- "The configuration file %s is corrupt." % file_config )
216
+ "The configuration file %s is corrupt." % file_config )
217
217
return None
218
218
except ValueError as error :
219
219
if file_config is not None and os .path .isfile (file_config ):
@@ -250,7 +250,7 @@ def _load_yaml(config):
250
250
if file_config is not None and os .path .isfile (file_config ):
251
251
LOGGER .exception ("The configuration file %s is corrupt." % file_config )
252
252
raise SATOSAConfigurationError (
253
- "The configuration file %s is corrupt." % file_config )
253
+ "The configuration file %s is corrupt." % file_config )
254
254
return None
255
255
except Exception as error :
256
256
if file_config is not None and os .path .isfile (file_config ):
@@ -280,7 +280,8 @@ def _readfile(config):
280
280
return None
281
281
282
282
283
- def _load_plugins (plugin_path , plugins , plugin_filter , filter_class , base_url , internal_attributes = None , * args ):
283
+ def _load_plugins (plugin_path , plugins , plugin_filter , filter_class , base_url ,
284
+ internal_attributes = None , * args ):
284
285
"""
285
286
Loads endpoint plugins
286
287
@@ -305,7 +306,7 @@ def _load_plugins(plugin_path, plugins, plugin_filter, filter_class, base_url, i
305
306
try :
306
307
module = plugin_source .load_plugin (module_file_name )
307
308
for name , obj in inspect .getmembers (module , plugin_filter ):
308
- loaded_plugins .append (obj (* args ))
309
+ loaded_plugins .append (obj (base_url , * args ))
309
310
loaded_plugin_names .append (module_file_name )
310
311
except ImportError as error :
311
312
LOGGER .debug ("Not a py file or import error '%s': %s" , module_file_name , error )
@@ -318,11 +319,11 @@ def _load_plugins(plugin_path, plugins, plugin_filter, filter_class, base_url, i
318
319
for parser in dict_parsers :
319
320
_config = parser ("%s/%s" % (path , module_file_name ))
320
321
if _config and "plugin" in _config :
321
- if _config ["plugin" ] == filter_class :
322
- done = True
323
- break
324
- else :
325
- _config = None
322
+ if _config ["plugin" ] == filter_class :
323
+ done = True
324
+ break
325
+ else :
326
+ _config = None
326
327
if done :
327
328
break
328
329
if _config is not None :
@@ -371,7 +372,7 @@ def _load_plugins(plugin_path, plugins, plugin_filter, filter_class, base_url, i
371
372
except Exception as error :
372
373
LOGGER .exception ("The configuration file %s is corrupt." % module_file_name )
373
374
raise SATOSAConfigurationError (
374
- "The configuration file %s is corrupt." % module_file_name ) from error
375
+ "The configuration file %s is corrupt." % module_file_name ) from error
375
376
LOGGER .debug ("Loaded plugins: {}" .format (loaded_plugin_names ))
376
377
return loaded_plugins
377
378
@@ -397,9 +398,10 @@ def load_micro_services(plugin_path, plugins, internal_attributes):
397
398
internal_attributes = internal_attributes )
398
399
399
400
LOGGER .info (
400
- "Loaded request micro services: %s" % [k .__class__ .__name__ for k in request_services ])
401
+ "Loaded request micro services: %s" % [k .__class__ .__name__ for k in request_services ])
401
402
LOGGER .info (
402
- "Loaded response micro services: %s" % [k .__class__ .__name__ for k in response_services ])
403
+ "Loaded response micro services: %s" % [k .__class__ .__name__ for k in
404
+ response_services ])
403
405
404
406
return (
405
407
build_micro_service_queue (request_services ), build_micro_service_queue (response_services ))
0 commit comments