mirror of
https://github.com/oskar456/dzonegit.git
synced 2024-05-11 05:55:41 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2e4a3daf7 | ||
|
|
4efef8be9e |
@@ -358,7 +358,8 @@ def template_config(checkoutpath, template, blacklist=set(), whitelist=set()):
|
||||
out = list()
|
||||
zones = dict()
|
||||
mapping = {"datetime": datetime.datetime.now().strftime("%c")}
|
||||
out.append(headertpl.substitute(mapping))
|
||||
if headertpl.template:
|
||||
out.append(headertpl.substitute(mapping))
|
||||
for f in sorted(Path(checkoutpath).glob("**/*.zone")):
|
||||
zonename = get_zone_name(f, f.read_bytes())
|
||||
if whitelist and not any(
|
||||
@@ -396,7 +397,8 @@ def template_config(checkoutpath, template, blacklist=set(), whitelist=set()):
|
||||
mapping, zonename=zonename,
|
||||
zonefile=str(f), zonevar=zonevar,
|
||||
))
|
||||
out.append(footertpl.substitute(mapping))
|
||||
if footertpl.template:
|
||||
out.append(footertpl.substitute(mapping))
|
||||
return "\n".join(out)
|
||||
|
||||
|
||||
|
||||
2
setup.py
2
setup.py
@@ -5,7 +5,7 @@ readme = Path(__file__).with_name("README.rst").read_text()
|
||||
|
||||
setup(
|
||||
name="dzonegit",
|
||||
version="0.10",
|
||||
version="0.11",
|
||||
description="Git hooks to manage a repository of DNS zones",
|
||||
long_description=readme,
|
||||
long_description_content_type="text/x-rst",
|
||||
|
||||
@@ -387,6 +387,8 @@ def test_template_config(git_dir):
|
||||
blacklist=set("*"),
|
||||
)
|
||||
assert " - zone: \"dummy\"\n file: \"" not in output
|
||||
output = dzonegit.template_config(str(git_dir), "{}")
|
||||
assert len(output) == 0
|
||||
|
||||
|
||||
def test_load_set_file(git_dir):
|
||||
|
||||
Reference in New Issue
Block a user