crmsh is incompatible with Python 3.x and results in the following error: File "/usr/sbin/crm", line 34 except ImportError, msg: ^ SyntaxError: invalid syntax crmsh is built with compatibility for Python 2.x, specifically known to work with 2.7, but may work with 2.6 and certain older versions. Reproducible: Always Steps to Reproduce: 1. Build with crmsh-1.2.5.ebuild which simply uses autotools-utils which auto-detects Python 3.2 in current systems. 2. Try running /usr/sbin/crm status 3. Resulting error will always show up. Actual Results: File "/usr/sbin/crm", line 34 except ImportError, msg: ^ SyntaxError: invalid syntax Expected Results: Could not establish cib_ro connection: Connection refused (111) Connection to cluster failed: Transport endpoint is not connected --- or --- Last updated: Sun Apr 21 09:43:47 2013 Last change: Mon Apr 15 00:55:15 2013 via cibadmin on {HOSTNAME} Stack: corosync Current DC: {HOSTNAME} (33558956) - partition with quorum Version: 1.1.8-3f6e0f0 2 Nodes configured, unknown expected votes 9 Resources configured. Online: [ {HOSTNAME} {HOSTNAME2} ] And more... crmsh is a cluster resource management shell interface to pacemaker, and was taken out of the main pacemaker codebase to allow for more modular approaches to such management interfaces, especially since crmsh itself is lacking maintenance these days by it's original developers. Will be filing bug against sys-cluster/pacemaker for required dependency for crmsh, since it's optional, not required.
Created attachment 346190 [details] Provided ebuild to support python-single-r1 with python:2.7 specifically as successful working scenario. This provides a functional and working ebuild example in full for building crmsh with python:2.7 specifically. I'm reasonably certain it could work with other versions, but how to implement it in gentoo's ebuild system I am not knowledgeable enough with gentoo's current python eclasses to do so reliably. This is proof of concept that does work however, and resolves the issue of crmsh being installed and run as Python 3.2 code which it will not do.
Comment on attachment 346190 [details] Provided ebuild to support python-single-r1 with python:2.7 specifically as successful working scenario. --- crmsh-1.2.5.ebuild 2013-02-14 14:38:53.000000000 +0100 +++ - 2013-04-22 13:17:34.996184235 +0200 @@ -2,9 +2,12 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/crmsh/crmsh-1.2.5.ebuild,v 1.1 2013/02/14 13:38:53 ultrabug Exp $ -EAPI=4 +EAPI=5 +#EAPI=4 +PYTHON_COMPAT="python2_7" -inherit autotools-utils +#inherit autotools-utils +inherit autotools-utils python-single-r1 MY_TREE="51379136d692" @@ -15,10 +18,11 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~hppa ~x86" -IUSE="" +IUSE="python" DEPEND=" >=sys-cluster/pacemaker-1.1.8 + || ( dev-lang/python:2.7 dev-lang/python:2.6 ) " RDEPEND="${DEPEND}" @@ -27,5 +31,23 @@ src_prepare() { sed -e 's@CRM_CACHE_DIR=${localstatedir}/cache/crm@CRM_CACHE_DIR=${localstatedir}/crmsh@g' \ -i configure.ac || die + sed -e 's:/usr/bin/python$:/usr/bin/python2.7:g' \ + -i ${S}/crm || die eautoreconf } + +src_configure() { + configure_crmsh() { + PYTHON="/usr/bin/python2.7" econf + } + configure_crmsh +} + +src_compile() { + default +} + +src_install() { + default +} +
Thanks jer & Eric, it's fixed +*crmsh-1.2.5-r2 (23 May 2013) + + 23 May 2013; Ultrabug <ultrabug@gentoo.org> -crmsh-1.2.5-r1.ebuild, + +crmsh-1.2.5-r2.ebuild: + fix #466668 thx to jer +