Ok with me, thanks for spotting and handling this.

Cheers,
---
jasper 

> On 9 Jul 2020, at 09:28, Florian Obser <flor...@openbsd.org> wrote:
> 
> This fixes:
> 
> 2020-07-09 08:38:42,136 [salt.state                                           
>                  :328 ][ERROR   ][26771] An exception occurred in this state: 
> Traceback (most recent call last):
>  File "/usr/local/lib/python3.8/site-packages/salt/state.py", line 2153, in 
> call
>    ret = self.states[cdata["full"]](
>  File "/usr/local/lib/python3.8/site-packages/salt/loader.py", line 2087, in 
> wrapper
>    return f(*args, **kwargs)
>  File "/usr/local/lib/python3.8/site-packages/salt/states/sysctl.py", line 
> 117, in present
>    update = __salt__["sysctl.persist"](name, value, config, ignore)
> TypeError: persist() takes from 2 to 3 positional arguments but 4 were given
> 
> 
> OK?
> 
> diff --git Makefile Makefile
> index ea0b8d03d59..1f38fa8af70 100644
> --- Makefile
> +++ Makefile
> @@ -19,7 +19,7 @@ COMMENT =        remote execution and configuration 
> management system
> 
> MODPY_EGG_VERSION =    3001
> DISTNAME =        salt-${MODPY_EGG_VERSION}
> -REVISION =        2
> +REVISION =        3
> 
> CATEGORIES =        sysutils net devel
> 
> diff --git patches/patch-salt_states_sysctl_py 
> patches/patch-salt_states_sysctl_py
> new file mode 100644
> index 00000000000..1f24dfbedc0
> --- /dev/null
> +++ patches/patch-salt_states_sysctl_py
> @@ -0,0 +1,20 @@
> +$OpenBSD$
> +"Only run sysctl ignore when configured"
> +https://github.com/saltstack/salt/pull/57841
> +
> +Index: salt/states/sysctl.py
> +--- salt/states/sysctl.py.orig
> ++++ salt/states/sysctl.py
> +@@ -114,7 +114,11 @@ def present(name, value, config=None, ignore=False):
> +         return ret
> + 
> +     try:
> +-        update = __salt__["sysctl.persist"](name, value, config, ignore)
> ++        if ignore:
> ++            # ignore is a linux only sysctl setting
> ++            update = __salt__["sysctl.persist"](name, value, config, ignore)
> ++        else:
> ++            update = __salt__["sysctl.persist"](name, value, config)
> +     except CommandExecutionError as exc:
> +         ret["result"] = False
> +         ret["comment"] = "Failed to set {0} to {1}: {2}".format(name, 
> value, exc)
> 
> 
> -- 
> I'm not entirely sure you are real.

Reply via email to