Mon Aug 6 05:01:26 2018 UTC ()
Update salt to 2018.3.2

pkgsrc changes:
- Add patch for NetBSD 8 support
- Update patches to note they can be removed in the next release
- Fix existing patch so it doesn't crash when running with swap enabled

Changes:
Version 2018.3.2 is a bugfix release for 2018.3.0.

The 2018.3.2 release contains only a small number of fixes, which are
detailed below.

This release fixes two critical issues.

The first is Issue #48038, which is a critical bug that occurs in a
multi-syndic setup where the same job is run multiple times on a minion.

The second issue is #48130. This bug appears in certain setups where the
Master reports a Minion time-out, even though the job is still running
on the Minion.

Both of these issues have been fixed with this release.


(tpaul)
diff -r1.64 -r1.65 pkgsrc/sysutils/salt/Makefile
diff -r1.38 -r1.39 pkgsrc/sysutils/salt/distinfo
diff -r1.6 -r1.7 pkgsrc/sysutils/salt/patches/patch-salt_grains_core.py
diff -r1.1 -r1.2 pkgsrc/sysutils/salt/patches/patch-salt_modules_pkgin.py
diff -r0 -r1.7 pkgsrc/sysutils/salt/patches/patch-salt_utils_network.py

cvs diff -r1.64 -r1.65 pkgsrc/sysutils/salt/Makefile (expand / switch to unified diff)

--- pkgsrc/sysutils/salt/Makefile 2018/06/20 15:00:15 1.64
+++ pkgsrc/sysutils/salt/Makefile 2018/08/06 05:01:26 1.65
@@ -1,17 +1,16 @@ @@ -1,17 +1,16 @@
1# $NetBSD: Makefile,v 1.64 2018/06/20 15:00:15 tpaul Exp $ 1# $NetBSD: Makefile,v 1.65 2018/08/06 05:01:26 tpaul Exp $
2 2
3DISTNAME= salt-2018.3.1 3DISTNAME= salt-2018.3.2
4PKGREVISION= 2 
5CATEGORIES= sysutils 4CATEGORIES= sysutils
6MASTER_SITES= ${MASTER_SITE_PYPI:=s/salt/} 5MASTER_SITES= ${MASTER_SITE_PYPI:=s/salt/}
7 6
8MAINTAINER= pkgsrc-users@NetBSD.org 7MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://saltstack.org/ 8HOMEPAGE= http://saltstack.org/
10COMMENT= Remote execution and configuration management system 9COMMENT= Remote execution and configuration management system
11LICENSE= apache-2.0 10LICENSE= apache-2.0
12 11
13DEPENDS+= ${PYPKGPREFIX}-jinja2-[0-9]*:../../textproc/py-jinja2 12DEPENDS+= ${PYPKGPREFIX}-jinja2-[0-9]*:../../textproc/py-jinja2
14DEPENDS+= ${PYPKGPREFIX}-markupsafe-[0-9]*:../../textproc/py-markupsafe 13DEPENDS+= ${PYPKGPREFIX}-markupsafe-[0-9]*:../../textproc/py-markupsafe
15DEPENDS+= ${PYPKGPREFIX}-msgpack-[0-9]*:../../devel/py-msgpack 14DEPENDS+= ${PYPKGPREFIX}-msgpack-[0-9]*:../../devel/py-msgpack
16DEPENDS+= ${PYPKGPREFIX}-yaml-[0-9]*:../../textproc/py-yaml 15DEPENDS+= ${PYPKGPREFIX}-yaml-[0-9]*:../../textproc/py-yaml
17DEPENDS+= ${PYPKGPREFIX}-requests>=2.5.0:../../devel/py-requests 16DEPENDS+= ${PYPKGPREFIX}-requests>=2.5.0:../../devel/py-requests

cvs diff -r1.38 -r1.39 pkgsrc/sysutils/salt/distinfo (expand / switch to unified diff)

--- pkgsrc/sysutils/salt/distinfo 2018/06/20 15:00:15 1.38
+++ pkgsrc/sysutils/salt/distinfo 2018/08/06 05:01:26 1.39
@@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
1$NetBSD: distinfo,v 1.38 2018/06/20 15:00:15 tpaul Exp $ 1$NetBSD: distinfo,v 1.39 2018/08/06 05:01:26 tpaul Exp $
2 2
3SHA1 (salt-2018.3.1.tar.gz) = 683dc72a84cf3a19dc1a5734837cf5b2dc19ef2a 3SHA1 (salt-2018.3.2.tar.gz) = 2df3d3c1c35d29b66909c74818ec6ec945c4550e
4RMD160 (salt-2018.3.1.tar.gz) = 8cc98668c98b89f9d244a665b5a9b76794754b32 4RMD160 (salt-2018.3.2.tar.gz) = ab3c0397658280307110f020f4d9d9042336d0ee
5SHA512 (salt-2018.3.1.tar.gz) = 38af8f1e8673f14e62d4a01bdb734efe8a7c8ca5cde83ce652ea0b1e260fbe7e3df04e27033c915b8d10c2ac49a88e26dae83b7f27798fb6ab53054a1329a840 5SHA512 (salt-2018.3.2.tar.gz) = 142ebe13638d7e6dd0aecc9f0325002d30e115fe8688f5f74cbeb7ff21020327d65ded0dcd845e55362b97568b696887fa22243d66d5eadef65f97152d4775d3
6Size (salt-2018.3.1.tar.gz) = 12939682 bytes 6Size (salt-2018.3.2.tar.gz) = 12996445 bytes
7SHA1 (patch-salt_grains_core.py) = 5d9c5fbee2a5bf7d0a3f3445fc51c3156cd252e1 7SHA1 (patch-salt_grains_core.py) = 780bea66de43764a82035a9d9a3c2ae884846d9f
8SHA1 (patch-salt_modules_pkgin.py) = 7c51659f740508e5b305a31eb0ab6396f522f677 8SHA1 (patch-salt_modules_pkgin.py) = f0141921e7faa6fb5bccfcd79f393a763f507d40
 9SHA1 (patch-salt_utils_network.py) = effce8b4e6cdabdf25624da653b05609f1ae92ed
9SHA1 (patch-salt_version.py) = 1827dac3609a938fae38ee5dfd2a873c9723dfbd 10SHA1 (patch-salt_version.py) = 1827dac3609a938fae38ee5dfd2a873c9723dfbd

cvs diff -r1.6 -r1.7 pkgsrc/sysutils/salt/patches/Attic/patch-salt_grains_core.py (expand / switch to unified diff)

--- pkgsrc/sysutils/salt/patches/Attic/patch-salt_grains_core.py 2018/06/20 15:00:16 1.6
+++ pkgsrc/sysutils/salt/patches/Attic/patch-salt_grains_core.py 2018/08/06 05:01:26 1.7
@@ -1,21 +1,24 @@ @@ -1,21 +1,24 @@
1$NetBSD: patch-salt_grains_core.py,v 1.6 2018/06/20 15:00:16 tpaul Exp $ 1$NetBSD: patch-salt_grains_core.py,v 1.7 2018/08/06 05:01:26 tpaul Exp $
2 2
3Prevent crash on NetBSD and OpenBSD when no swap is configured. 3Prevent crash on NetBSD and OpenBSD when no swap is configured.
4https://github.com/saltstack/salt/pull/47600 4https://github.com/saltstack/salt/pull/47600
5PR: pkg/53278 5PR: pkg/53278
6 6
 7This patch should no longer be needed in 2018.3.3
 8https://github.com/saltstack/salt/pull/47866
 9
7--- salt/grains/core.py.orig 2018-06-13 16:03:06.000000000 +0000 10--- salt/grains/core.py.orig 2018-06-13 16:03:06.000000000 +0000
8+++ salt/grains/core.py 11+++ salt/grains/core.py
9@@ -451,7 +451,11 @@ def _bsd_memdata(osdata): 12@@ -451,7 +451,11 @@ def _bsd_memdata(osdata):
10  13
11 if osdata['kernel'] in ['OpenBSD', 'NetBSD']: 14 if osdata['kernel'] in ['OpenBSD', 'NetBSD']:
12 swapctl = salt.utils.path.which('swapctl') 15 swapctl = salt.utils.path.which('swapctl')
13- swap_total = __salt__['cmd.run']('{0} -sk'.format(swapctl)).split(' ')[1] 16- swap_total = __salt__['cmd.run']('{0} -sk'.format(swapctl)).split(' ')[1]
14+ swap_total = __salt__['cmd.run']('{0} -sk'.format(swapctl)) 17+ swap_total = __salt__['cmd.run']('{0} -sk'.format(swapctl))
15+ if swap_total == 'no swap devices configured': 18+ if swap_total == 'no swap devices configured':
16+ swap_total = 0 19+ swap_total = 0
17+ else: 20+ else:
18+ swap_total = swap_data.split(' ')[1] 21+ swap_total = swap_total.split(' ')[1]
19 else: 22 else:
20 swap_total = __salt__['cmd.run']('{0} -n vm.swap_total'.format(sysctl)) 23 swap_total = __salt__['cmd.run']('{0} -n vm.swap_total'.format(sysctl))
21 grains['swap_total'] = int(swap_total) // 1024 // 1024 24 grains['swap_total'] = int(swap_total) // 1024 // 1024

cvs diff -r1.1 -r1.2 pkgsrc/sysutils/salt/patches/Attic/patch-salt_modules_pkgin.py (expand / switch to unified diff)

--- pkgsrc/sysutils/salt/patches/Attic/patch-salt_modules_pkgin.py 2018/06/20 11:50:56 1.1
+++ pkgsrc/sysutils/salt/patches/Attic/patch-salt_modules_pkgin.py 2018/08/06 05:01:26 1.2
@@ -1,21 +1,24 @@ @@ -1,21 +1,24 @@
1$NetBSD: patch-salt_modules_pkgin.py,v 1.1 2018/06/20 11:50:56 tpaul Exp $ 1$NetBSD: patch-salt_modules_pkgin.py,v 1.2 2018/08/06 05:01:26 tpaul Exp $
2 2
3Fixes 2 bugs in the pkgin module: 3Fixes 2 bugs in the pkgin module:
4- pkg.latest_version doesn't return a version for an uninstalled package. 4- pkg.latest_version doesn't return a version for an uninstalled package.
5- pkg.file_dict crashes. 5- pkg.file_dict crashes.
6https://github.com/saltstack/salt/pull/47814 6https://github.com/saltstack/salt/pull/47814
7PR: pkg/53344 7PR: pkg/53344
8 8
 9This patch should no longer be needed in 2018.3.3
 10https://github.com/saltstack/salt/pull/47866
 11
9--- salt/modules/pkgin.py.orig 2018-04-02 16:35:12.000000000 +0000 12--- salt/modules/pkgin.py.orig 2018-04-02 16:35:12.000000000 +0000
10+++ salt/modules/pkgin.py 13+++ salt/modules/pkgin.py
11@@ -181,7 +181,9 @@ def latest_version(*names, **kwargs): 14@@ -181,7 +181,9 @@ def latest_version(*names, **kwargs):
12  15
13 out = __salt__['cmd.run'](cmd, output_loglevel='trace') 16 out = __salt__['cmd.run'](cmd, output_loglevel='trace')
14 for line in out.splitlines(): 17 for line in out.splitlines():
15- p = line.split(',' if _supports_parsing() else None) 18- p = line.split(',' if _supports_parsing() else None)
16+ if line.startswith('No results found for'): 19+ if line.startswith('No results found for'):
17+ return pkglist  20+ return pkglist
18+ p = line.split(';' if _supports_parsing() else None) 21+ p = line.split(';' if _supports_parsing() else None)
19  22
20 if p and p[0] in ('=:', '<:', '>:', ''): 23 if p and p[0] in ('=:', '<:', '>:', ''):
21 # These are explanation comments 24 # These are explanation comments

File Added: pkgsrc/sysutils/salt/patches/Attic/patch-salt_utils_network.py
$NetBSD: patch-salt_utils_network.py,v 1.7 2018/08/06 05:01:26 tpaul Exp $

Handle new ifconfig output on NetBSD 8.0

Upstream issue: https://github.com/saltstack/salt/issues/48856
Upstream pull request: https://github.com/saltstack/salt/pull/48926

--- salt/utils/network.py.orig	2018-06-27 16:04:57.000000000 +0000
+++ salt/utils/network.py
@@ -15,6 +15,7 @@ import platform
 import random
 import subprocess
 from string import ascii_letters, digits
+from salt.utils.versions import LooseVersion
 
 # Import 3rd-party libs
 from salt.ext import six
@@ -862,6 +863,83 @@ def linux_interfaces():
     return ifaces
 
 
+def _netbsd_interfaces_ifconfig(out):
+    '''
+    Uses ifconfig to return a dictionary of interfaces with various information
+    about each (up/down state, ip address, netmask, and hwaddr)
+    '''
+    ret = dict()
+
+    piface = re.compile(r'^([^\s:]+)')
+    pmac = re.compile('.*?address: ([0-9a-f:]+)')
+
+    pip = re.compile(r'.*?inet [^\d]*(.*?)/([\d]*)\s')
+    pip6 = re.compile('.*?inet6 ([0-9a-f:]+)%([a-zA-Z0-9]*)/([\d]*)\s')
+
+    pupdown = re.compile('UP')
+    pbcast = re.compile(r'.*?broadcast ([\d\.]+)')
+
+    groups = re.compile('\r?\n(?=\\S)').split(out)
+    for group in groups:
+        data = dict()
+        iface = ''
+        updown = False
+        for line in group.splitlines():
+            miface = piface.match(line)
+            mmac = pmac.match(line)
+            mip = pip.match(line)
+            mip6 = pip6.match(line)
+            mupdown = pupdown.search(line)
+            if miface:
+                iface = miface.group(1)
+            if mmac:
+                data['hwaddr'] = mmac.group(1)
+            if mip:
+                if 'inet' not in data:
+                    data['inet'] = list()
+                addr_obj = dict()
+                addr_obj['address'] = mip.group(1)
+                mmask = mip.group(2)
+                if mip.group(2):
+                    addr_obj['netmask'] = cidr_to_ipv4_netmask(mip.group(2))
+                mbcast = pbcast.match(line)
+                if mbcast:
+                    addr_obj['broadcast'] = mbcast.group(1)
+                data['inet'].append(addr_obj)
+            if mupdown:
+                updown = True
+            if mip6:
+                if 'inet6' not in data:
+                    data['inet6'] = list()
+                addr_obj = dict()
+                addr_obj['address'] = mip6.group(1)
+                mmask6 = mip6.group(3)
+                addr_obj['scope'] = mip6.group(2)
+                addr_obj['prefixlen'] = mip6.group(3)
+                data['inet6'].append(addr_obj)
+        data['up'] = updown
+        ret[iface] = data
+        del data
+    return ret
+
+def netbsd_interfaces():
+    '''
+    Obtain interface information for NetBSD >= 8 where the ifconfig
+    output diverged from other BSD variants (Netmask is now part of the
+    address)
+    '''
+    # NetBSD versions prior to 8.0 can still use linux_interfaces()
+    if LooseVersion(os.uname()[2]) < LooseVersion('8.0'):
+        return linux_interfaces()
+
+    ifconfig_path = salt.utils.path.which('ifconfig')
+    cmd = subprocess.Popen(
+        '{0} -a'.format(ifconfig_path),
+        shell=True,
+        stdout=subprocess.PIPE,
+        stderr=subprocess.STDOUT).communicate()[0]
+    return _netbsd_interfaces_ifconfig(salt.utils.stringutils.to_str(cmd))
+
 def _interfaces_ipconfig(out):
     '''
     Returns a dictionary of interfaces with various information about each
@@ -963,10 +1041,11 @@ def interfaces():
     '''
     if salt.utils.platform.is_windows():
         return win_interfaces()
+    elif salt.utils.platform.is_netbsd():
+        return netbsd_interfaces()
     else:
         return linux_interfaces()
 
-
 def get_net_start(ipaddr, netmask):
     '''
     Return the address of the network