Skip to content

Commit

Permalink
salt: Do not interpolate when parsing sysctl config files
Browse files Browse the repository at this point in the history
Fixes: #3223
  • Loading branch information
gdemonet committed Mar 23, 2021
1 parent 79e5bec commit 82ee169
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# CHANGELOG

## Release 2.8.1 (in development)
### Bug fixes

- [#3223](https://github.com/scality/metalk8s/issues/3223) - Prevent failures
when some `sysctl` configuration file contains a `%` character
(PR [#3224](https://github.com/scality/metalk8s/pull/3224))

## Release 2.8.0
### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion salt/_modules/metalk8s_sysctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def has_precedence(name, value, config, strict=False):
)
)

parser = configparser.ConfigParser()
parser = configparser.ConfigParser(interpolation=None)
epured_value = " ".join(str(value).split())

for sysctl_file in sysctl_files:
Expand Down
1 change: 1 addition & 0 deletions salt/tests/unit/modules/files/test_metalk8s_sysctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ filesystem_tree:
net.ipv4.ip_forward=0
/etc/sysctl.d/99-sysctl.conf: |-
net.ipv4.ip_forward=1
kernel.some-fancy-pattern=%prefix-fancy-value-%suffix
/etc/sysctl.conf: ""

has_precedence:
Expand Down

0 comments on commit 82ee169

Please sign in to comment.