Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677432 - 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
Summary: net-analyzer/check_mk_agent-1.4.0_p31 - Python based plugins fail to run on s...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-07 12:53 UTC by Timo Gurr
Modified: 2020-12-09 11:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
}