feat: update makejinja to 2.5.0 (#1221)
* feat: update makejinja to 2.5.0 and implement mjfilter Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: move logic for skip tests Signed-off-by: Devin Buhl <devin@buhl.casa> * feat: update makejinja to 2.5.0 Signed-off-by: Devin Buhl <devin@buhl.casa> --------- Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
8265c80909
commit
4be97f78e8
4 files changed
+8
-9
No files matched your search
@@ -1,4 +1,6 @@
|
||||
from typing import Any
|
||||
import bcrypt
|
||||
import makejinja
|
||||
import netaddr
|
||||
|
||||
import validation
|
||||
@@ -16,12 +18,12 @@ def nthhost(value: str, query: int) -> str:
|
||||
def encrypt(value: str) -> str:
|
||||
return bcrypt.hashpw(value.encode(), bcrypt.gensalt(rounds=10)).decode("ascii")
|
||||
|
||||
class Loader:
|
||||
def __init__(self, data):
|
||||
class Plugin(makejinja.plugin.Plugin):
|
||||
def __init__(self, data: dict[str, Any]):
|
||||
if data.get("skip_tests", False):
|
||||
return
|
||||
|
||||
validation.validate(data)
|
||||
|
||||
def filters(self):
|
||||
def filters(self) -> makejinja.plugin.Filters:
|
||||
return [nthhost, encrypt]
|
||||
Reference in new issue
Block a user