From nobody@FreeBSD.org  Mon Feb  3 01:38:47 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 36D149DD
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Feb 2014 01:38:47 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 16B791AA4
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Feb 2014 01:38:47 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s131cktr094630
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Feb 2014 01:38:46 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s131ck7t094626;
	Mon, 3 Feb 2014 01:38:46 GMT
	(envelope-from nobody)
Message-Id: <201402030138.s131ck7t094626@oldred.freebsd.org>
Date: Mon, 3 Feb 2014 01:38:46 GMT
From: Michele Carlson <mike@bayphoto.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: py-salt patch breaks salt
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: christer.edwards@gmail.com

>Number:         186397
>Category:       ports
>Synopsis:       sysutils/py-salt patch breaks salt
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-python
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 03 01:40:00 UTC 2014
>Closed-Date:    Fri Apr 18 04:07:53 UTC 2014
>Last-Modified:  Fri Apr 18 04:07:53 UTC 2014
>Originator:     Michele Carlson
>Release:        10.0-RELEASE
>Organization:
Bay Photo Lab
>Environment:
FreeBSD fbsd-qa.discdrive.bayphoto.com 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
the patch file in sysutils/py-salt/files/patch-salt__modules__reebsdpkg.py
breaks pkg support on FreeBSD 10

FreeBSD 10 does not have /usr/local/etc/pkg.conf, but the original
freebsdpkg.py checks for /var/db/pkg/local.sqlite, which seems to be
accurate across 9.x and 10.0 systems
>How-To-Repeat:
Install Salt:

pkg install -y py27-salt

Accept that systems key, and use the pkg.list_pkgs module:


root@fbsd-qa:/usr/ports/sysutils/py-salt # salt-call pkg.list_pkgs
[INFO    ] Executing command '/sbin/zfs help || :' in directory '/root'
[INFO    ] Executing command 'None' in directory '/root'
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/local/bin/salt-call", line 9, in <module>
    load_entry_point('salt==0.17.4', 'console_scripts', 'salt-call')()
  File "/usr/local/lib/python2.7/site-packages/salt/scripts.py", line 77, in salt_call
    client.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/__init__.py", line 303, in run
    caller.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 135, in run
    ret = self.call()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 78, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/salt/modules/freebsdpkg.py", line 187, in list_pkgs
    pkg, ver = line.split(' ')[0].rsplit('-', 1)
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/local/bin/salt-call", line 9, in <module>
    load_entry_point('salt==0.17.4', 'console_scripts', 'salt-call')()
  File "/usr/local/lib/python2.7/site-packages/salt/scripts.py", line 77, in salt_call
    client.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/__init__.py", line 303, in run
    caller.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 135, in run
    ret = self.call()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 78, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/salt/modules/freebsdpkg.py", line 187, in list_pkgs
    pkg, ver = line.split(' ')[0].rsplit('-', 1)
ValueError: need more than 1 value to unpack

>Fix:
Index: sysutils/py-salt/files/patch-salt__modules__reebsdpkg.py
===================================================================
--- sysutils/py-salt/files/patch-salt__modules__reebsdpkg.py    (revision 342371)
+++ sysutils/py-salt/files/patch-salt__modules__reebsdpkg.py    (working copy)
@@ -1,11 +0,0 @@
---- salt/modules/freebsdpkg.py.orig    2013-10-30 16:16:31.850225522 +0000
-+++ salt/modules/freebsdpkg.py 2013-10-30 16:16:47.868224728 +0000
-@@ -27,7 +27,7 @@
-     '''
-     Looks to see if pkgng is being used by checking if database exists
-     '''
--    return os.path.isfile('/var/db/pkg/local.sqlite')
-+    return os.path.isfile('/usr/local/etc/pkg.conf')
-
-
- @decorators.memoize


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-python 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Feb 3 10:40:13 UTC 2014 
Responsible-Changed-Why:  
freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186397 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon Feb 3 10:40:15 UTC 2014 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186397 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: christer.edwards@gmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/186397: sysutils/py-salt patch breaks salt
Date: Mon, 3 Feb 2014 10:40:14 UT

 Maintainer of sysutils/py-salt,
 
 Please note that PR ports/186397 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/186397
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
State-Changed-From-To: feedback->closed 
State-Changed-By: xmj 
State-Changed-When: Fri Apr 18 04:07:52 UTC 2014 
State-Changed-Why:  
Patch included in revision 348607 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186397 
>Unformatted:
