mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-12 07:45:16 +00:00
fix(): solve metadata replace (#1755)
Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
@@ -63,8 +63,9 @@ class Check(ABC, Check_Metadata_Model):
|
|||||||
def __init__(self, **data):
|
def __init__(self, **data):
|
||||||
"""Check's init function. Calls the CheckMetadataModel init."""
|
"""Check's init function. Calls the CheckMetadataModel init."""
|
||||||
# Parse the Check's metadata file
|
# Parse the Check's metadata file
|
||||||
metadata_file = os.path.abspath(sys.modules[self.__module__].__file__).replace(
|
metadata_file = (
|
||||||
".py", ".metadata.json"
|
os.path.abspath(sys.modules[self.__module__].__file__)[:-3]
|
||||||
|
+ ".metadata.json"
|
||||||
)
|
)
|
||||||
# Store it to validate them with Pydantic
|
# Store it to validate them with Pydantic
|
||||||
data = Check_Metadata_Model.parse_file(metadata_file).dict()
|
data = Check_Metadata_Model.parse_file(metadata_file).dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user