Skip to content

Commit

Permalink
🚑 Variables not local, but superglobal instead
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelWaldvogel committed Jan 30, 2021
1 parent 12da7bb commit d200e28
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).


# 0.3.2 - 2021-01-30
## Added

## Fixed
- Variables were superglobal (global over all zones), instead of local

## Changed


# 0.3.1 - 2021-01-30
## Added

Expand Down
7 changes: 4 additions & 3 deletions dnstemple/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def expand_include(filename, line, config):
args = line.split()
if len(args) < 2:
exit(f"Format mismatch `$ADDRESS <file> [<var>=<value>…]` in {filename}: {line}")
# Add arguments to copy of config
# Add arguments to copy of config variables (partial deep copy)
config = dict(config)
config['variables'] = dict(config['variables'])
for arg in args[2:]:
(key, value) = arg.split('=')
config['variables'][key] = value
Expand Down Expand Up @@ -153,8 +154,8 @@ def process(filename, config):
output.append(line)
else:
if expect_name and line[0] in ' \t':
sys.stderr.write(f"WARNING: Line may have undefined name"
" in {filename}: {line}\n")
sys.stderr.write("WARNING: Line may have undefined name"
f" in {filename}: {line}\n")
output.append(line)
expect_name = False
return output
Expand Down
2 changes: 1 addition & 1 deletion dnstemple/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.3.1'
VERSION = '0.3.2'

0 comments on commit d200e28

Please sign in to comment.