Skip to content

Commit d200e28

Browse files
🚑 Variables not local, but superglobal instead
1 parent 12da7bb commit d200e28

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](https://semver.org/).
66

77

8+
# 0.3.2 - 2021-01-30
9+
## Added
10+
11+
## Fixed
12+
- Variables were superglobal (global over all zones), instead of local
13+
14+
## Changed
15+
16+
817
# 0.3.1 - 2021-01-30
918
## Added
1019

dnstemple/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ def expand_include(filename, line, config):
114114
args = line.split()
115115
if len(args) < 2:
116116
exit(f"Format mismatch `$ADDRESS <file> [<var>=<value>…]` in {filename}: {line}")
117-
# Add arguments to copy of config
117+
# Add arguments to copy of config variables (partial deep copy)
118118
config = dict(config)
119+
config['variables'] = dict(config['variables'])
119120
for arg in args[2:]:
120121
(key, value) = arg.split('=')
121122
config['variables'][key] = value
@@ -153,8 +154,8 @@ def process(filename, config):
153154
output.append(line)
154155
else:
155156
if expect_name and line[0] in ' \t':
156-
sys.stderr.write(f"WARNING: Line may have undefined name"
157-
" in {filename}: {line}\n")
157+
sys.stderr.write("WARNING: Line may have undefined name"
158+
f" in {filename}: {line}\n")
158159
output.append(line)
159160
expect_name = False
160161
return output

dnstemple/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.3.1'
1+
VERSION = '0.3.2'

0 commit comments

Comments
 (0)