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.diff -r1.64 -r1.65 pkgsrc/sysutils/salt/Makefile
(tpaul)
@@ -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 | |||
3 | DISTNAME= salt-2018.3.1 | 3 | DISTNAME= salt-2018.3.2 | |
4 | PKGREVISION= 2 | |||
5 | CATEGORIES= sysutils | 4 | CATEGORIES= sysutils | |
6 | MASTER_SITES= ${MASTER_SITE_PYPI:=s/salt/} | 5 | MASTER_SITES= ${MASTER_SITE_PYPI:=s/salt/} | |
7 | 6 | |||
8 | MAINTAINER= pkgsrc-users@NetBSD.org | 7 | MAINTAINER= pkgsrc-users@NetBSD.org | |
9 | HOMEPAGE= http://saltstack.org/ | 8 | HOMEPAGE= http://saltstack.org/ | |
10 | COMMENT= Remote execution and configuration management system | 9 | COMMENT= Remote execution and configuration management system | |
11 | LICENSE= apache-2.0 | 10 | LICENSE= apache-2.0 | |
12 | 11 | |||
13 | DEPENDS+= ${PYPKGPREFIX}-jinja2-[0-9]*:../../textproc/py-jinja2 | 12 | DEPENDS+= ${PYPKGPREFIX}-jinja2-[0-9]*:../../textproc/py-jinja2 | |
14 | DEPENDS+= ${PYPKGPREFIX}-markupsafe-[0-9]*:../../textproc/py-markupsafe | 13 | DEPENDS+= ${PYPKGPREFIX}-markupsafe-[0-9]*:../../textproc/py-markupsafe | |
15 | DEPENDS+= ${PYPKGPREFIX}-msgpack-[0-9]*:../../devel/py-msgpack | 14 | DEPENDS+= ${PYPKGPREFIX}-msgpack-[0-9]*:../../devel/py-msgpack | |
16 | DEPENDS+= ${PYPKGPREFIX}-yaml-[0-9]*:../../textproc/py-yaml | 15 | DEPENDS+= ${PYPKGPREFIX}-yaml-[0-9]*:../../textproc/py-yaml | |
17 | DEPENDS+= ${PYPKGPREFIX}-requests>=2.5.0:../../devel/py-requests | 16 | DEPENDS+= ${PYPKGPREFIX}-requests>=2.5.0:../../devel/py-requests |
@@ -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 | |||
3 | SHA1 (salt-2018.3.1.tar.gz) = 683dc72a84cf3a19dc1a5734837cf5b2dc19ef2a | 3 | SHA1 (salt-2018.3.2.tar.gz) = 2df3d3c1c35d29b66909c74818ec6ec945c4550e | |
4 | RMD160 (salt-2018.3.1.tar.gz) = 8cc98668c98b89f9d244a665b5a9b76794754b32 | 4 | RMD160 (salt-2018.3.2.tar.gz) = ab3c0397658280307110f020f4d9d9042336d0ee | |
5 | SHA512 (salt-2018.3.1.tar.gz) = 38af8f1e8673f14e62d4a01bdb734efe8a7c8ca5cde83ce652ea0b1e260fbe7e3df04e27033c915b8d10c2ac49a88e26dae83b7f27798fb6ab53054a1329a840 | 5 | SHA512 (salt-2018.3.2.tar.gz) = 142ebe13638d7e6dd0aecc9f0325002d30e115fe8688f5f74cbeb7ff21020327d65ded0dcd845e55362b97568b696887fa22243d66d5eadef65f97152d4775d3 | |
6 | Size (salt-2018.3.1.tar.gz) = 12939682 bytes | 6 | Size (salt-2018.3.2.tar.gz) = 12996445 bytes | |
7 | SHA1 (patch-salt_grains_core.py) = 5d9c5fbee2a5bf7d0a3f3445fc51c3156cd252e1 | 7 | SHA1 (patch-salt_grains_core.py) = 780bea66de43764a82035a9d9a3c2ae884846d9f | |
8 | SHA1 (patch-salt_modules_pkgin.py) = 7c51659f740508e5b305a31eb0ab6396f522f677 | 8 | SHA1 (patch-salt_modules_pkgin.py) = f0141921e7faa6fb5bccfcd79f393a763f507d40 | |
9 | SHA1 (patch-salt_utils_network.py) = effce8b4e6cdabdf25624da653b05609f1ae92ed | |||
9 | SHA1 (patch-salt_version.py) = 1827dac3609a938fae38ee5dfd2a873c9723dfbd | 10 | SHA1 (patch-salt_version.py) = 1827dac3609a938fae38ee5dfd2a873c9723dfbd |
@@ -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 | |||
3 | Prevent crash on NetBSD and OpenBSD when no swap is configured. | 3 | Prevent crash on NetBSD and OpenBSD when no swap is configured. | |
4 | https://github.com/saltstack/salt/pull/47600 | 4 | https://github.com/saltstack/salt/pull/47600 | |
5 | PR: pkg/53278 | 5 | PR: pkg/53278 | |
6 | 6 | |||
7 | This patch should no longer be needed in 2018.3.3 | |||
8 | https://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 |
@@ -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 | |||
3 | Fixes 2 bugs in the pkgin module: | 3 | Fixes 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. | |
6 | https://github.com/saltstack/salt/pull/47814 | 6 | https://github.com/saltstack/salt/pull/47814 | |
7 | PR: pkg/53344 | 7 | PR: pkg/53344 | |
8 | 8 | |||
9 | This patch should no longer be needed in 2018.3.3 | |||
10 | https://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 |
$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