-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for storage backend and event handler plugins
Signed-off-by: Christian Pinto <christian.pinto@ibm.com>
- Loading branch information
1 parent
49d8c33
commit c1d1a8c
Showing
11 changed files
with
104 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,8 @@ tests/.pytest_cache | |
# Remove directory __pycache__ | ||
__pycache__ | ||
venv | ||
|
||
.idea | ||
build | ||
sunfish.egg-info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright IBM Corp. 2024 | ||
# This software is available to you under a BSD 3-Clause License. | ||
# The full license terms are available here: https://github.com/OpenFabrics/sunfish_library_reference/blob/main/LICENSE | ||
|
||
import importlib | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
plugins_namespace_name = "sunfish_plugins" | ||
|
||
|
||
def load_plugin(plugin: dict): | ||
module_name = f"{plugins_namespace_name}.{plugin['module_name']}" | ||
logger.info(f"Loading plugin {module_name}...") | ||
plugin_module = importlib.import_module(module_name) | ||
logger.info("Plugin loaded") | ||
return getattr(plugin_module, plugin["class_name"]) | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
import json | ||
import logging | ||
import os | ||
from uuid import uuid4 | ||
import warnings | ||
|
||
import requests | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters