diff options
author | sborrill <sborrill@pkgsrc.org> | 2017-02-06 12:48:18 +0000 |
---|---|---|
committer | sborrill <sborrill@pkgsrc.org> | 2017-02-06 12:48:18 +0000 |
commit | 312b7c3765165817b1218811dd93fce380e4821d (patch) | |
tree | 25881faae53f5072a56685d8cbc88e98ffb2f3f5 | |
parent | c8262a94a2f7e99135bb0e0c3ed3719ec8d79f4b (diff) | |
download | pkgsrc-312b7c3765165817b1218811dd93fce380e4821d.tar.gz |
Fix NetBSD sockstat parsing.
Bump PKGREVISION
-rw-r--r-- | sysutils/salt/Makefile | 3 | ||||
-rw-r--r-- | sysutils/salt/distinfo | 3 | ||||
-rw-r--r-- | sysutils/salt/patches/patch-salt_utils_network.py | 48 |
3 files changed, 52 insertions, 2 deletions
diff --git a/sysutils/salt/Makefile b/sysutils/salt/Makefile index d2280566f19..eec8a1f2f81 100644 --- a/sysutils/salt/Makefile +++ b/sysutils/salt/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.45 2017/02/03 13:39:00 sborrill Exp $ +# $NetBSD: Makefile,v 1.46 2017/02/06 12:48:18 sborrill Exp $ DISTNAME= salt-2016.11.2 +PKGREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_PYPI:=s/salt/} diff --git a/sysutils/salt/distinfo b/sysutils/salt/distinfo index bcffb1eb547..b1ff6836964 100644 --- a/sysutils/salt/distinfo +++ b/sysutils/salt/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.23 2017/02/03 13:39:00 sborrill Exp $ +$NetBSD: distinfo,v 1.24 2017/02/06 12:48:18 sborrill Exp $ SHA1 (salt-2016.11.2.tar.gz) = 00cc3ad1af9e40e4cfa2572c45058e3342944413 RMD160 (salt-2016.11.2.tar.gz) = cd6b75fb78e9bf52116c05866682a49cb96f67d2 SHA512 (salt-2016.11.2.tar.gz) = 0dbc861424643af664edd2d9cb8bcbde7e9bcf7c1d202a5e844af83c21dc2d75fd7034db27dffc58dc2a6e47cfe2ea2c42e2a9af867c7ca78f93166eb4fd03ad Size (salt-2016.11.2.tar.gz) = 9114042 bytes +SHA1 (patch-salt_utils_network.py) = 54a1b8fb53b6b65aa6c07b39506e2c1dcd57b54a diff --git a/sysutils/salt/patches/patch-salt_utils_network.py b/sysutils/salt/patches/patch-salt_utils_network.py new file mode 100644 index 00000000000..6a600bb4299 --- /dev/null +++ b/sysutils/salt/patches/patch-salt_utils_network.py @@ -0,0 +1,48 @@ +$NetBSD: patch-salt_utils_network.py,v 1.5 2017/02/06 12:48:18 sborrill Exp $ + +Fix sockstat parsing on NetBSD. +https://github.com/saltstack/salt/pull/39189 + +--- salt/utils/network.py.orig 2017-01-30 18:13:20.000000000 +0000 ++++ salt/utils/network.py 2017-02-06 11:38:34.000000000 +0000 +@@ -1057,23 +1057,23 @@ + Parses output of shell 'sockstat' (NetBSD) + to get connections + +- $ sudo sockstat -4 ++ $ sudo sockstat -4 -n + USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS +- root python2.7 1456 29 tcp4 *.4505 *.* +- root python2.7 1445 17 tcp4 *.4506 *.* +- root python2.7 1294 14 tcp4 127.0.0.1.11813 127.0.0.1.4505 +- root python2.7 1294 41 tcp4 127.0.0.1.61115 127.0.0.1.4506 ++ root python2.7 1456 29 tcp *.4505 *.* ++ root python2.7 1445 17 tcp *.4506 *.* ++ root python2.7 1294 14 tcp 127.0.0.1.11813 127.0.0.1.4505 ++ root python2.7 1294 41 tcp 127.0.0.1.61115 127.0.0.1.4506 + +- $ sudo sockstat -4 -c -p 4506 ++ $ sudo sockstat -4 -c -n -p 4506 + USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS +- root python2.7 1294 41 tcp4 127.0.0.1.61115 127.0.0.1.4506 ++ root python2.7 1294 41 tcp 127.0.0.1.61115 127.0.0.1.4506 + ''' + + port = int(port) + remotes = set() + + try: +- cmd = salt.utils.shlex_split('sockstat -4 -c -p {0}'.format(port)) ++ cmd = salt.utils.shlex_split('sockstat -4 -c -n -p {0}'.format(port)) + data = subprocess.check_output(cmd) # pylint: disable=minimum-python-version + except subprocess.CalledProcessError as ex: + log.error('Failed "sockstat" with returncode = {0}'.format(ex.returncode)) +@@ -1085,7 +1085,7 @@ + chunks = line.split() + if not chunks: + continue +- # ['root', 'python2.7', '1456', '37', 'tcp4', ++ # ['root', 'python2.7', '1456', '37', 'tcp', + # '127.0.0.1.4505-', '127.0.0.1.55703'] + # print chunks + if 'COMMAND' in chunks[1]: |