Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Dec 2016 19:56:51 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r427986 - in head/sysutils/py-salt: . files
Message-ID:  <201612061956.uB6JupeG046367@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Tue Dec  6 19:56:51 2016
New Revision: 427986
URL: https://svnweb.freebsd.org/changeset/ports/427986

Log:
  sysutils/py-salt: put back sysctl patch
  
  It's not yet merged upstream
  
  Reported by:	Dani Ilg <ilg.dani@outlook.com> (private email)
  Approved by:	Christer Edwards <christer.edwards@gmail.com> (private email)

Added:
  head/sysutils/py-salt/files/patch-freebsd_sysctl.py   (contents, props changed)
Modified:
  head/sysutils/py-salt/Makefile

Modified: head/sysutils/py-salt/Makefile
==============================================================================
--- head/sysutils/py-salt/Makefile	Tue Dec  6 19:56:36 2016	(r427985)
+++ head/sysutils/py-salt/Makefile	Tue Dec  6 19:56:51 2016	(r427986)
@@ -3,6 +3,7 @@
 
 PORTNAME=	salt
 PORTVERSION=	2016.11.0
+PORTREVISION=	1
 CATEGORIES=	sysutils python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

Added: head/sysutils/py-salt/files/patch-freebsd_sysctl.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/py-salt/files/patch-freebsd_sysctl.py	Tue Dec  6 19:56:51 2016	(r427986)
@@ -0,0 +1,44 @@
+--- salt/modules/freebsd_sysctl.py.orig	2016-10-31 11:21:36.000000000 -0600
++++ salt/modules/freebsd_sysctl.py      2016-11-02 08:44:19.743993000 -0600
+@@ -56,17 +56,31 @@
+     )
+     cmd = 'sysctl -ae'
+     ret = {}
+-    out = __salt__['cmd.run'](cmd, output_loglevel='trace')
+     comps = ['']
+-    for line in out.splitlines():
+-        if any([line.startswith('{0}.'.format(root)) for root in roots]):
+-            comps = line.split('=', 1)
+-            ret[comps[0]] = comps[1]
+-        elif comps[0]:
+-            ret[comps[0]] += '{0}\n'.format(line)
+-        else:
+-            continue
+-    return ret
++
++    if config_file:
++        try:
++            with salt.utils.fopen(config_file, 'r') as f:
++                for line in f.readlines():
++                    l = line.strip()
++                    if l != "" and not l.startswith("#"):
++                        comps = line.split('=', 1)
++                        ret[comps[0]] = comps[1]
++            return ret
++        except (OSError, IOError):
++            log.error('Could not open sysctl config file')
++            return None
++    else:
++        out = __salt__['cmd.run'](cmd, output_loglevel='trace')
++        for line in out.splitlines():
++            if any([line.startswith('{0}.'.format(root)) for root in roots]):
++                comps = line.split('=', 1)
++                ret[comps[0]] = comps[1]
++            elif comps[0]:
++                ret[comps[0]] += '{0}\n'.format(line)
++            else:
++                 continue
++        return ret
+ 
+ 
+ def get(name):



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612061956.uB6JupeG046367>