Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 466668 - sys-cluster/crmsh is incompatible with Python 3.x and requires 2.x. Ebuild provided with single support for 2.7
Summary: sys-cluster/crmsh is incompatible with Python 3.x and requires 2.x. Ebuild pr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords: EBUILD, PATCH
Depends on:
Blocks:
 
Reported: 2013-04-21 13:47 UTC by Eric Renfro
Modified: 2013-05-23 09:59 UTC (History)
0 users

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


Attachments
Provided ebuild to support python-single-r1 with python:2.7 specifically as successful working scenario. (crmsh-1.2.5-r1.ebuild,1.13 KB, text/plain)
2013-04-21 13:49 UTC, Eric Renfro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Renfro 2013-04-21 13:47:01 UTC
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.
Comment 1 Eric Renfro 2013-04-21 13:49:50 UTC
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 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-04-22 11:17:46 UTC
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
+}
+
Comment 3 Ultrabug gentoo-dev 2013-05-23 09:59:26 UTC
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
+