Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9EE6718C7A for ; Mon, 21 Mar 2016 10:33:53 +0000 (UTC) Received: (qmail 13843 invoked by uid 500); 21 Mar 2016 10:33:53 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 13812 invoked by uid 500); 21 Mar 2016 10:33:53 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 13803 invoked by uid 99); 21 Mar 2016 10:33:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2016 10:33:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2BC6FDFB77; Mon, 21 Mar 2016 10:33:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vbrodetskyi@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-15483. Strange paths in ambari-server setup.(vbrodetskyi) Date: Mon, 21 Mar 2016 10:33:53 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 5d52b70dd -> 76fd6809d AMBARI-15483. Strange paths in ambari-server setup.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/76fd6809 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/76fd6809 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/76fd6809 Branch: refs/heads/trunk Commit: 76fd6809d9d8d8483412f89734a83d19b36840ca Parents: 5d52b70 Author: Vitaly Brodetskyi Authored: Mon Mar 21 09:46:48 2016 +0200 Committer: Vitaly Brodetskyi Committed: Mon Mar 21 09:46:48 2016 +0200 ---------------------------------------------------------------------- .../src/main/python/ambari_server/serverConfiguration.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/76fd6809/ambari-server/src/main/python/ambari_server/serverConfiguration.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py index 29187bd..a5e7bee 100644 --- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py +++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py @@ -226,10 +226,12 @@ def get_ambari_properties(): properties = Properties() with open(conf_file) as hfR: properties.load(hfR) - + + root = os.environ["ROOT"].rstrip("/") + for k,v in properties.iteritems(): - properties.__dict__[k] = v.replace("$ROOT", os.environ["ROOT"]) - properties._props[k] = v.replace("$ROOT", os.environ["ROOT"]) + properties.__dict__[k] = v.replace("$ROOT", root) + properties._props[k] = v.replace("$ROOT", root) except (Exception), e: print 'Could not read "%s": %s' % (conf_file, e) return -1