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: RESOLVED PKGREMOVED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PMASKED
Depends on: 933843
Blocks:
  Show dependency tree
 
Reported: 2019-02-07 12:53 UTC by Timo Gurr
Modified: 2024-07-12 11:31 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
}
Comment 1 Larry the Git Cow gentoo-dev 2024-07-12 11:31:07 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a679b467c1c5f7502194ab0cad5f04afb9989bd

commit 7a679b467c1c5f7502194ab0cad5f04afb9989bd
Author:     Arthur Zamarin <arthurzam@gentoo.org>
AuthorDate: 2024-07-12 11:28:50 +0000
Commit:     Arthur Zamarin <arthurzam@gentoo.org>
CommitDate: 2024-07-12 11:28:50 +0000

    net-analyzer/check_mk_agent: treeclean
    
    Bug: https://bugs.gentoo.org/933843
    Bug: https://bugs.gentoo.org/695068
    Bug: https://bugs.gentoo.org/677432
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>

 net-analyzer/check_mk_agent/Manifest               |  1 -
 .../check_mk_agent/check_mk_agent-1.4.0_p31.ebuild | 74 ----------------------
 net-analyzer/check_mk_agent/metadata.xml           | 23 -------
 profiles/package.mask                              |  5 --
 4 files changed, 103 deletions(-)