pkgsrc-Changes archive

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

CVS commit: pkgsrc/sysutils/salt



Module Name:    pkgsrc
Committed By:   maya
Date:           Sat May 12 11:29:36 UTC 2018

Modified Files:
        pkgsrc/sysutils/salt: Makefile distinfo
Added Files:
        pkgsrc/sysutils/salt/patches: patch-salt_grains_core.py

Log Message:
salt: don't crash if no swap is configured
(in a netbsd/openbsd specific code block)

from Travis Paul in PR pkg/53278, also upstream pull #47600
bump PKGREVISION


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 pkgsrc/sysutils/salt/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/sysutils/salt/distinfo
cvs rdiff -u -r0 -r1.3 pkgsrc/sysutils/salt/patches/patch-salt_grains_core.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/salt/Makefile
diff -u pkgsrc/sysutils/salt/Makefile:1.59 pkgsrc/sysutils/salt/Makefile:1.60
--- pkgsrc/sysutils/salt/Makefile:1.59  Fri Apr 13 07:58:22 2018
+++ pkgsrc/sysutils/salt/Makefile       Sat May 12 11:29:35 2018
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.59 2018/04/13 07:58:22 adam Exp $
+# $NetBSD: Makefile,v 1.60 2018/05/12 11:29:35 maya Exp $
 
 DISTNAME=      salt-2018.3.0
+PKGREVISION=   1
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_PYPI:=s/salt/}
 

Index: pkgsrc/sysutils/salt/distinfo
diff -u pkgsrc/sysutils/salt/distinfo:1.34 pkgsrc/sysutils/salt/distinfo:1.35
--- pkgsrc/sysutils/salt/distinfo:1.34  Fri Apr 13 07:58:22 2018
+++ pkgsrc/sysutils/salt/distinfo       Sat May 12 11:29:35 2018
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.34 2018/04/13 07:58:22 adam Exp $
+$NetBSD: distinfo,v 1.35 2018/05/12 11:29:35 maya Exp $
 
 SHA1 (salt-2018.3.0.tar.gz) = b891aa96775a9675fef7ca98a78073fed304e062
 RMD160 (salt-2018.3.0.tar.gz) = 54ea78736292c97367c4b34b586bce25b434ecce
 SHA512 (salt-2018.3.0.tar.gz) = 3d64a4d12d4ff7effe644b682b138d8f49fd00523e9cfe3e80bebff9c944a089fb41cbac92e63139633425f49c1eebeb99145290a0bdd1b4f306da86abe9b2e5
 Size (salt-2018.3.0.tar.gz) = 13448567 bytes
+SHA1 (patch-salt_grains_core.py) = 735a71cd9616be34cce6b015da7a70cace08accd
 SHA1 (patch-salt_version.py) = 1827dac3609a938fae38ee5dfd2a873c9723dfbd

Added files:

Index: pkgsrc/sysutils/salt/patches/patch-salt_grains_core.py
diff -u /dev/null pkgsrc/sysutils/salt/patches/patch-salt_grains_core.py:1.3
--- /dev/null   Sat May 12 11:29:36 2018
+++ pkgsrc/sysutils/salt/patches/patch-salt_grains_core.py      Sat May 12 11:29:35 2018
@@ -0,0 +1,25 @@
+$NetBSD: patch-salt_grains_core.py,v 1.3 2018/05/12 11:29:35 maya Exp $
+
+Prevent crash on NetBSD and OpenBSD when no swap is configured.
+https://github.com/saltstack/salt/pull/47600
+
+--- salt/grains/core.py.orig   2018-05-11 13:12:38.000000000 +0000
++++ salt/grains/core.py
+@@ -450,11 +450,13 @@ def _bsd_memdata(osdata):
+             mem = __salt__['cmd.run']('{0} -n hw.physmem64'.format(sysctl))
+         grains['mem_total'] = int(mem) // 1024 // 1024
+
+-        if osdata['kernel'] == 'OpenBSD':
++        if osdata['kernel'] in ['OpenBSD', 'NetBSD']:
+             swapctl = salt.utils.path.which('swapctl')
+-            swap_total = __salt__['cmd.run']('{0} -sk'.format(swapctl)).split(' ')[1]
+-        else:
+-            swap_total = __salt__['cmd.run']('{0} -n vm.swap_total'.format(sysctl))
++            swap_data = __salt__['cmd.run']('{0} -sk'.format(swapctl))
++            if swap_data == 'no swap devices configured':
++                swap_total = 0
++            else:
++                swap_total = swap_data.split(' ')[1]
+         grains['swap_total'] = int(swap_total) // 1024 // 1024
+     return grains
+



Home | Main Index | Thread Index | Old Index