From owner-svn-ports-head@freebsd.org Tue Dec 6 19:56:52 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C76C6AEC6; Tue, 6 Dec 2016 19:56:52 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28F421D84; Tue, 6 Dec 2016 19:56:52 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6JupIB046369; Tue, 6 Dec 2016 19:56:51 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6JupeG046367; Tue, 6 Dec 2016 19:56:51 GMT (envelope-from swills@FreeBSD.org) Message-Id: <201612061956.uB6JupeG046367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Tue, 6 Dec 2016 19:56:51 +0000 (UTC) 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 X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 19:56:52 -0000 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 (private email) Approved by: Christer Edwards (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):