Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 677432

Summary: net-analyzer/check_mk_agent-1.4.0_p31 - Python based plugins fail to run on systems that have Python3 as their default Python interpreter
Product: Gentoo Linux Reporter: Timo Gurr <timo.gurr>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: UNCONFIRMED ---    
Severity: normal CC: axs
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Timo Gurr 2019-02-07 12:53:52 UTC
check_mk_agent plugins don't specify their python shebang properly as required by https://www.python.org/dev/peps/pep-0394/:

#!/usr/bin/python

so on system that have Python3 set as their default Python interpreter the plugins silently fail to run during check_mk, or not silently when called directly, e.g. plugins/apache_status:

  File "/usr/lib/check_mk_agent/plugins/apache_status", line 146
    except urllib2.URLError, e:
                           ^
SyntaxError: invalid syntax


This should be brought to attention upstream, I've sent an email to their feedback address as they don't seem to have some community user friendly way to report bugs. For now something along the line could be added to the ebuild:


src_prepare() {
	# Errors when running under Python 3
	sed \
		-e 's:/usr/bin/python:/usr/bin/python2:' \
		-i "${S}"/plugins/{apache_status,isc_dhcpd,mk_inotify,mk_mongodb} \
		|| die

	default
}