Re: Update salt to 2019.2.3

2020-02-06 Thread Uwe Werler
On 05 Feb 23:39, Uwe Werler wrote:
> Hi,
> 
> this is an update to salt 2019.2.3.
> 
> I'm currently testing this version on our development salt master and haven't
> seen any issues yet wether with the master nor the minion.
> 
> Comments welcome.
> 
> Regards Uwe

Hi,

I included some changes Rafael suggested. But still the port needs further
testing.

Also cc to Jasper now.

Regards Uwe
Index: Makefile
===
RCS file: /cvs/ports/sysutils/salt/Makefile,v
retrieving revision 1.135
diff -u -p -u -r1.135 Makefile
--- Makefile12 Jul 2019 20:49:51 -  1.135
+++ Makefile6 Feb 2020 10:29:07 -
@@ -1,7 +1,7 @@
 # $OpenBSD: Makefile,v 1.135 2019/07/12 20:49:51 sthen Exp $
 
 # optional dependencies
-# https://github.com/saltstack/salt/blob/develop/doc/conf.py#L54
+# https://github.com/saltstack/salt/blob/develop/doc/conf.py
 # libvirt-python
 # py-GitPython
 # py-croniter
@@ -17,13 +17,12 @@
 
 COMMENT =  remote execution and configuration management system
 
-MODPY_EGG_VERSION =2018.3.3
+MODPY_EGG_VERSION =2019.2.3
 DISTNAME = salt-${MODPY_EGG_VERSION}
-REVISION = 0
 
 CATEGORIES =   sysutils net devel
 
-HOMEPAGE = http://saltstack.org/
+HOMEPAGE = https://community.saltstack.com
 
 MAINTAINER =   Jasper Lievisse Adriaanse 
 
@@ -71,10 +70,6 @@ TEST_DEPENDS =   databases/py-mysql \
net/rabbitmq \
sysutils/salt-testing \
www/py-CherryPy
-
-# https://github.com/saltstack/salt/pull/45164
-post-extract:
-   cp ${FILESDIR}/{pf,vmctl}.py ${WRKSRC}/salt/modules/
 
 pre-configure:
${SUBST_CMD} ${WRKSRC}/salt/returners/zabbix_return.py
Index: distinfo
===
RCS file: /cvs/ports/sysutils/salt/distinfo,v
retrieving revision 1.49
diff -u -p -u -r1.49 distinfo
--- distinfo28 Jan 2019 19:25:27 -  1.49
+++ distinfo6 Feb 2020 10:29:07 -
@@ -1,2 +1,2 @@
-SHA256 (salt-2018.3.3.tar.gz) = 3PMNLo6uEFpyl3xRz8JT+8TcKLL3Enf9zp013h62PhU=
-SIZE (salt-2018.3.3.tar.gz) = 13953724
+SHA256 (salt-2019.2.3.tar.gz) = dJfn2/1Nw3mbu8jaY9qYuDAbu2RBUPOQX+V3Wn2BJxo=
+SIZE (salt-2019.2.3.tar.gz) = 14572686
Index: files/pf.py
===
RCS file: files/pf.py
diff -N files/pf.py
--- files/pf.py 24 May 2018 16:59:40 -  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,349 +0,0 @@
-# -*- coding: utf-8 -*-
-'''
-Control the OpenBSD packet filter (PF).
-
-:codeauthor: Jasper Lievisse Adriaanse 
-
-.. versionadded:: Fluorine
-'''
-
-from __future__ import absolute_import
-
-# Import python libs
-import logging
-import re
-
-# Import salt libs
-import salt.utils.path
-from salt.exceptions import (CommandExecutionError, SaltInvocationError)
-
-log = logging.getLogger(__name__)
-
-
-def __virtual__():
-'''
-Only works on OpenBSD for now; other systems with pf (macOS, FreeBSD, etc)
-need to be tested before enabling them.
-'''
-if __grains__['os'] == 'OpenBSD' and salt.utils.path.which('pfctl'):
-return True
-
-return (False, 'The pf execution module cannot be loaded: either the 
system is not OpenBSD or the pfctl binary was not found')
-
-
-def enable():
-'''
-Enable the Packet Filter.
-
-CLI example:
-
-.. code-block:: bash
-
-salt '*' pf.enable
-'''
-ret = {}
-result = __salt__['cmd.run_all']('pfctl -e',
- output_loglevel='trace',
- python_shell=False)
-
-if result['retcode'] == 0:
-ret = {'comment': 'pf enabled', 'changes': True}
-else:
-# If pf was already enabled the return code is also non-zero.
-# Don't raise an exception in that case.
-if result['stderr'] == 'pfctl: pf already enabled':
-ret = {'comment': 'pf already enabled', 'changes': False}
-else:
-raise CommandExecutionError(
-'Could not enable pf',
-info={'errors': [result['stderr']], 'changes': False}
-)
-
-return ret
-
-
-def disable():
-'''
-Disable the Packet Filter.
-
-CLI example:
-
-.. code-block:: bash
-
-salt '*' pf.disable
-'''
-ret = {}
-result = __salt__['cmd.run_all']('pfctl -d',
- output_loglevel='trace',
- python_shell=False)
-
-if result['retcode'] == 0:
-ret = {'comment': 'pf disabled', 'changes': True}
-else:
-# If pf was already disabled the return code is also non-zero.
-# Don't raise an exception in that case.
-if result['stderr'] == 'pfctl: pf not enabled':
-ret = {'comment': 'pf already disabled', 'changes': False}
-  

Update salt to 2019.2.3

2020-02-05 Thread Uwe Werler
Hi,

this is an update to salt 2019.2.3.

I'm currently testing this version on our development salt master and haven't
seen any issues yet wether with the master nor the minion.

Comments welcome.

Regards Uwe
Index: Makefile
===
RCS file: /cvs/ports/sysutils/salt/Makefile,v
retrieving revision 1.135
diff -u -p -u -r1.135 Makefile
--- Makefile12 Jul 2019 20:49:51 -  1.135
+++ Makefile5 Feb 2020 23:25:14 -
@@ -17,7 +17,7 @@
 
 COMMENT =  remote execution and configuration management system
 
-MODPY_EGG_VERSION =2018.3.3
+MODPY_EGG_VERSION =2019.2.3
 DISTNAME = salt-${MODPY_EGG_VERSION}
 REVISION = 0
 
Index: distinfo
===
RCS file: /cvs/ports/sysutils/salt/distinfo,v
retrieving revision 1.49
diff -u -p -u -r1.49 distinfo
--- distinfo28 Jan 2019 19:25:27 -  1.49
+++ distinfo5 Feb 2020 23:25:14 -
@@ -1,2 +1,2 @@
-SHA256 (salt-2018.3.3.tar.gz) = 3PMNLo6uEFpyl3xRz8JT+8TcKLL3Enf9zp013h62PhU=
-SIZE (salt-2018.3.3.tar.gz) = 13953724
+SHA256 (salt-2019.2.3.tar.gz) = dJfn2/1Nw3mbu8jaY9qYuDAbu2RBUPOQX+V3Wn2BJxo=
+SIZE (salt-2019.2.3.tar.gz) = 14572686
Index: patches/patch-salt_modules_openbsd_sysctl_py
===
RCS file: patches/patch-salt_modules_openbsd_sysctl_py
diff -N patches/patch-salt_modules_openbsd_sysctl_py
--- patches/patch-salt_modules_openbsd_sysctl_py25 Apr 2018 10:02:48 
-  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,28 +0,0 @@
-$OpenBSD: patch-salt_modules_openbsd_sysctl_py,v 1.2 2018/04/25 10:02:48 
jasper Exp $
-
-https://github.com/saltstack/salt/pull/45228
-
-Index: salt/modules/openbsd_sysctl.py
 salt/modules/openbsd_sysctl.py.orig
-+++ salt/modules/openbsd_sysctl.py
-@@ -4,6 +4,7 @@ Module for viewing and modifying OpenBSD sysctl parame
- '''
- from __future__ import absolute_import, print_function, unicode_literals
- import os
-+import re
- 
- # Import salt libs
- from salt.ext import six
-@@ -76,7 +77,11 @@ def assign(name, value):
- cmd = 'sysctl {0}="{1}"'.format(name, value)
- data = __salt__['cmd.run_all'](cmd)
- 
--if data['retcode'] != 0:
-+# Certain values cannot be set from this console, at the current
-+# securelevel or there are other restrictions that prevent us
-+# from applying the setting rightaway.
-+if re.match(r'^sysctl:.*: Operation not permitted$', data['stderr']) or \
-+  data['retcode'] != 0:
- raise CommandExecutionError('sysctl failed: {0}'.format(
- data['stderr']))
- new_name, new_value = data['stdout'].split(':', 1)
Index: patches/patch-salt_modules_openbsdpkg_py
===
RCS file: patches/patch-salt_modules_openbsdpkg_py
diff -N patches/patch-salt_modules_openbsdpkg_py
--- patches/patch-salt_modules_openbsdpkg_py25 Apr 2018 10:02:48 -  
1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,187 +0,0 @@
-$OpenBSD: patch-salt_modules_openbsdpkg_py,v 1.2 2018/04/25 10:02:48 jasper 
Exp $
-
-- fix `latest_version` for installed packages
-- have purge pass '-cqq' to pkg_delete
-- implement upgrading packages
-
-Index: salt/modules/openbsdpkg.py
 salt/modules/openbsdpkg.py.orig
-+++ salt/modules/openbsdpkg.py
-@@ -100,8 +100,13 @@ def list_pkgs(versions_as_list=False, **kwargs):
- 
- def latest_version(*names, **kwargs):
- '''
--The available version of the package in the repository
-+Return the latest version of the named package available for upgrade or
-+installation. If more than one package name is specified, a dict of
-+name/version pairs is returned.
- 
-+If the latest version of a given package is already installed, an empty
-+string will be returned for that package.
-+
- CLI Example:
- 
- .. code-block:: bash
-@@ -116,20 +121,43 @@ def latest_version(*names, **kwargs):
- for name in names:
- ret[name] = ''
- 
--cmd = 'pkg_info -q -I {0}'.format(' '.join(names))
--out = __salt__['cmd.run_stdout'](cmd, python_shell=False, 
output_loglevel='trace')
--for line in out.splitlines():
--try:
--pkgname, pkgver, flavor = __PKG_RE.match(line).groups()
--except AttributeError:
--continue
--pkgname += '--{0}'.format(flavor) if flavor else ''
--cur = pkgs.get(pkgname, '')
--if not cur or salt.utils.versions.compare(ver1=cur,
--  oper='<',
--  ver2=pkgver):
--ret[pkgname] = pkgver
-+# Query the repository for the package name
-+cmd = 'pkg_info -Q {0}'.format(name)
-+out = __salt__['cmd.run_stdout'](cmd, python_shell=False, 
output_loglevel='trace')
-+ 
-+# Since we can only query inste