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 98D47186EC for ; Fri, 2 Oct 2015 20:39:17 +0000 (UTC) Received: (qmail 63947 invoked by uid 500); 2 Oct 2015 20:39:17 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 63910 invoked by uid 500); 2 Oct 2015 20:39:17 -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 63895 invoked by uid 99); 2 Oct 2015 20:39:17 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2015 20:39:17 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id D4289275FD6; Fri, 2 Oct 2015 20:39:16 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1316978549624720994==" MIME-Version: 1.0 Subject: Re: Review Request 38806: AMBARI-13242: ambari-server setup failed if use another server as ambari-server next time From: "Andrew Onischuk" To: "Alejandro Fernandez" , "Andrew Onischuk" , "Sid Wagle" Cc: "Di Li" , "Ambari" Date: Fri, 02 Oct 2015 20:39:16 -0000 Message-ID: <20151002203916.1725.77810@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Andrew Onischuk" X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/38806/ X-Sender: "Andrew Onischuk" References: <20151002203643.1726.73195@reviews.apache.org> In-Reply-To: <20151002203643.1726.73195@reviews.apache.org> Reply-To: "Andrew Onischuk" X-ReviewRequest-Repository: ambari --===============1316978549624720994== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Oct. 2, 2015, 8:36 p.m., Alejandro Fernandez wrote: > > ambari-agent/src/main/package/rpm/postremove.sh, line 27 > > > > > > My suggestion here is that this type of logic may lead to bugs in the future, once we support a higher version of python, because ambari python wrap has its own logic for picking the python version. > > > > Python isn't necessarily guaranteed to be in that location, so ideally we would either > > A. Iterate over all of the versions of python installed and attempt to delete these ambari folders > > > > Or > > > > B. Share the same logic that calculates which python version to use, and call it from this script. > > > > This is something that requires testing on non-default paths of Python, and also multiple python versions installed. E.g., only 2.6, only 2.7, or both. Alejandro, we already support python 2.7 but still we use /usr/lib/python2.6/site-packages directory to store/execute ambari-agent python scripts independent of the python version. That's why this code is fine IMO. - Andrew ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/38806/#review101370 ----------------------------------------------------------- On Oct. 1, 2015, 8:13 p.m., Di Li wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/38806/ > ----------------------------------------------------------- > > (Updated Oct. 1, 2015, 8:13 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Andrew Onischuk, and Sid Wagle. > > > Bugs: AMBARI-13242 > https://issues.apache.org/jira/browse/AMBARI-13242 > > > Repository: ambari > > > Description > ------- > > The uninstall script in RPM does not clean up the symbolic links created in /usr/lib/python2.6/site-packages. The broken links causes following err if user tries to install Ambari server on a node that has been previously installed with Ambari agent. Vise Versa. > > File "/usr/sbin/ambari-server.py", line 26, in > from ambari_commons.exceptions import FatalException, NonFatalException > File "/usr/lib/python2.6/site-packages/ambari_commons/_init_.py", line 21, in > File "/usr/lib/python2.6/site-packages/ambari_commons/os_check.py", line 133, in > File "/usr/lib/python2.6/site-packages/ambari_commons/os_check.py", line 115, in _init_ > File "/usr/lib/python2.6/site-packages/ambari_commons/os_check.py", line 112, in initialize_data > > > Diffs > ----- > > ambari-agent/pom.xml 0096162 > ambari-agent/src/main/package/rpm/postremove.sh PRE-CREATION > ambari-server/pom.xml 3377961 > ambari-server/src/main/package/rpm/postremove.sh PRE-CREATION > > Diff: https://reviews.apache.org/r/38806/diff/ > > > Testing > ------- > > Generate Ambari Server and Agent RPMs > Install the Ambari Agent RPM on a machine > Run yum erase to remove the Ambari Agent RPM > verify the symbolic links in /usr/lib/python2.6/site-packages are removed. > On the very same machine, now install Ambari Server RPM > verify the RPM install is successful, and can start/stop Ambari server. > Run yum erase to remove the Ambari Server RPM > verify the symbolic links in /usr/lib/python2.6/site-packages are removed. > > > Thanks, > > Di Li > > --===============1316978549624720994==--