Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4DAF2182FB for ; Fri, 28 Aug 2015 12:03:46 +0000 (UTC) Received: (qmail 73087 invoked by uid 500); 28 Aug 2015 12:03:46 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 73046 invoked by uid 500); 28 Aug 2015 12:03:46 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 73025 invoked by uid 99); 28 Aug 2015 12:03:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2015 12:03:46 +0000 Date: Fri, 28 Aug 2015 12:03:46 +0000 (UTC) From: "Hudson (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-12912) Python Wrapper Can Choose Two Different Python Versions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-12912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14718400#comment-14718400 ] Hudson commented on AMBARI-12912: --------------------------------- ABORTED: Integrated in Ambari-branch-2.1 #439 (See [https://builds.apache.org/job/Ambari-branch-2.1/439/]) AMBARI-12912. Python Wrapper Can Choose Two Different Python Versions (aonishuk) (aonishuk: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=bb877b81ad7eea4921274eb66c6b973d34dd649a) * ambari-common/src/main/unix/ambari-python-wrap > Python Wrapper Can Choose Two Different Python Versions > ------------------------------------------------------- > > Key: AMBARI-12912 > URL: https://issues.apache.org/jira/browse/AMBARI-12912 > Project: Ambari > Issue Type: Bug > Reporter: Andrew Onischuk > Assignee: Andrew Onischuk > Fix For: 2.1.2 > > > Environments that have 2 different versions of Python cause problems when > running agent code in memory. This was encountered on an Ambari 1.6 upgrade to > 2.1 where Python 2.6 had all of the site-packages, but python2.7 was being > chosen by the agent. > The `ambari-python-wrap` script is the problem. Consider the code: > > > > export PYTHONPATH=/usr/lib/python2.6/site-packages:/usr/lib/python2.6/site-packages/ambari_commons:$PYTHONPATH > > # reset settings > unset PYTHON > > # checking for preferable python versions > if [ -a /usr/bin/python2.7 ] && [ -z "$PYTHON" ]; then > PYTHON=/usr/bin/python2.7 > fi > > if [ -a /usr/bin/python2.6 ] && [ -z "$PYTHON" ]; then > PYTHON=/usr/bin/python2.6 > fi > > This is hardcoding the `PYTHONPATH` to use `site-packages` from `python2.6`. > But then, it choose the Python 2.7 executor as the wrapper. This means that > the agents will be running as Python 2.7 and executing scripts with a Python > 2.6 site-package. > The observed problem was that the "rpm" and "yum" packages could not be loaded > by agent code on an INSTALL command since these packages were part of the 2.6 > site-packages and not 2.7 site-packages. -- This message was sent by Atlassian JIRA (v6.3.4#6332)