pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/salt Fix NetBSD sockstat parsing.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aa4614359cc9
branches:  trunk
changeset: 358163:aa4614359cc9
user:      sborrill <sborrill%pkgsrc.org@localhost>
date:      Mon Feb 06 12:48:18 2017 +0000

description:
Fix NetBSD sockstat parsing.
Bump PKGREVISION

diffstat:

 sysutils/salt/Makefile                            |   3 +-
 sysutils/salt/distinfo                            |   3 +-
 sysutils/salt/patches/patch-salt_utils_network.py |  48 +++++++++++++++++++++++
 3 files changed, 52 insertions(+), 2 deletions(-)

diffs (76 lines):

diff -r 9dc28fd9e3fe -r aa4614359cc9 sysutils/salt/Makefile
--- a/sysutils/salt/Makefile    Mon Feb 06 12:45:20 2017 +0000
+++ b/sysutils/salt/Makefile    Mon Feb 06 12:48:18 2017 +0000
@@ -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 -r 9dc28fd9e3fe -r aa4614359cc9 sysutils/salt/distinfo
--- a/sysutils/salt/distinfo    Mon Feb 06 12:45:20 2017 +0000
+++ b/sysutils/salt/distinfo    Mon Feb 06 12:48:18 2017 +0000
@@ -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 -r 9dc28fd9e3fe -r aa4614359cc9 sysutils/salt/patches/patch-salt_utils_network.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/salt/patches/patch-salt_utils_network.py Mon Feb 06 12:48:18 2017 +0000
@@ -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]:



Home | Main Index | Thread Index | Old Index