fix(): solve metadata replace (#1755)

Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
Sergio Garcia
2023-01-24 13:45:46 +01:00
committed by GitHub
parent f9b985e03d
commit 36925f0dbd

View File

@@ -63,8 +63,9 @@ class Check(ABC, Check_Metadata_Model):
def __init__(self, **data):
"""Check's init function. Calls the CheckMetadataModel init."""
# Parse the Check's metadata file
metadata_file = os.path.abspath(sys.modules[self.__module__].__file__).replace(
".py", ".metadata.json"
metadata_file = (
os.path.abspath(sys.modules[self.__module__].__file__)[:-3]
+ ".metadata.json"
)
# Store it to validate them with Pydantic
data = Check_Metadata_Model.parse_file(metadata_file).dict()