You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/02/18 16:56:28 UTC

ambari git commit: AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 0c568cc8a -> 0bd63c80b


AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0bd63c80
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0bd63c80
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0bd63c80

Branch: refs/heads/trunk
Commit: 0bd63c80b337e0818a5cb55781998c174e4cf6fa
Parents: 0c568cc
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Feb 18 17:56:22 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Feb 18 17:56:22 2016 +0200

----------------------------------------------------------------------
 .../src/main/repo/install_ambari_tarball.py     |   2 +-
 ambari-server/conf/unix/ambari-env.sh           |   6 +-
 ambari-server/conf/unix/ambari.properties       |  30 +++---
 ambari-server/conf/unix/install-helper.sh       |   7 +-
 ambari-server/pom.xml                           |   1 +
 ambari-server/sbin/ambari-server                |  57 +++++-----
 .../src/main/package/deb/control/preinst        |   2 +-
 ambari-server/src/main/python/ambari-server.py  |  17 +--
 .../main/python/ambari_server/BackupRestore.py  |  11 +-
 .../src/main/python/ambari_server/ambariPath.py |  39 +++++++
 .../ambari_server/dbConfiguration_linux.py      |  29 +++---
 .../python/ambari_server/serverConfiguration.py | 103 ++++++++++---------
 .../main/python/ambari_server/serverSetup.py    |   6 +-
 .../src/test/python/TestAmbariServer.py         |   2 +-
 14 files changed, 185 insertions(+), 127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-common/src/main/repo/install_ambari_tarball.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/repo/install_ambari_tarball.py b/ambari-common/src/main/repo/install_ambari_tarball.py
index 5c65b60..e6578b0 100644
--- a/ambari-common/src/main/repo/install_ambari_tarball.py
+++ b/ambari-common/src/main/repo/install_ambari_tarball.py
@@ -200,7 +200,7 @@ class Installer:
     if self.verbose:
       bash_args.append("-x")
       
-    Utils.os_call(["bash"] + bash_args + [script_name] + args, env={ROOT_FOLDER_ENV_VARIABLE: self.root_folder})
+    Utils.os_call(["bash"] + bash_args + [script_name] + args, env={ROOT_FOLDER_ENV_VARIABLE: self.root_folder}, logoutput=True)
     
 
 class TargzInstaller(Installer):

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/conf/unix/ambari-env.sh
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari-env.sh b/ambari-server/conf/unix/ambari-env.sh
index bf7ae56..e9fdcdd 100644
--- a/ambari-server/conf/unix/ambari-env.sh
+++ b/ambari-server/conf/unix/ambari-env.sh
@@ -15,9 +15,9 @@
 
 
 AMBARI_PASSHPHRASE="DEV"
-export AMBARI_JVM_ARGS=$AMBARI_JVM_ARGS' -Xms512m -Xmx2048m -Djava.security.auth.login.config=/etc/ambari-server/conf/krb5JAASLogin.conf -Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false'
-export PATH=$PATH:/var/lib/ambari-server
-export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages
+export AMBARI_JVM_ARGS=$AMBARI_JVM_ARGS' -Xms512m -Xmx2048m -Djava.security.auth.login.config=$ROOT/etc/ambari-server/conf/krb5JAASLogin.conf -Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false'
+export PATH=$PATH:$ROOT/var/lib/ambari-server
+export PYTHONPATH=$PYTHONPATH:$ROOT/usr/lib/python2.6/site-packages
 
 # customize python binary for ambari
 # export PYTHON=/usr/bin/python2

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/conf/unix/ambari.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties
index 23f3187..81ef446 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -16,12 +16,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-security.server.keys_dir = /var/lib/ambari-server/keys
+security.server.keys_dir = $ROOT/var/lib/ambari-server/keys
 #security.server.disabled.ciphers=SSL_RSA_WITH_DES_CBC_SHA|SSL_RSA_EXPORT_WITH_RC4_40_MD5|SSL_DHE_RSA_WITH_DES_CBC_SHA|SSL_DHE_DSS_WITH_DES_CBC_SHA|SSL_RSA_EXPORT_WITH_DES40_CBC_SHA|SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA|SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA|SSL_RSA_WITH_3DES_EDE_CBC_SHA|SSL_DHE_RSA_WITH_DES_CBC_SHA
 #security.server.disabled.protocols=SSL|SSLv2|SSLv3
-resources.dir = /var/lib/ambari-server/resources
-shared.resources.dir = /usr/lib/ambari-server/lib/ambari_commons/resources
-custom.action.definitions = /var/lib/ambari-server/resources/custom_action_definitions
+resources.dir = $ROOT/var/lib/ambari-server/resources
+shared.resources.dir = $ROOT/usr/lib/ambari-server/lib/ambari_commons/resources
+custom.action.definitions = $ROOT/var/lib/ambari-server/resources/custom_action_definitions
 
 java.releases=jdk1.8,jdk1.7
 jdk1.7.desc=Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
@@ -41,16 +41,16 @@ jdk1.8.re=(jdk.*)/jre
 jdk.download.supported=true
 jce.download.supported=true
 
-metadata.path=/var/lib/ambari-server/resources/stacks
-common.services.path=/var/lib/ambari-server/resources/common-services
-server.version.file=/var/lib/ambari-server/resources/version
-webapp.dir=/usr/lib/ambari-server/web
-bootstrap.dir=/var/run/ambari-server/bootstrap
-bootstrap.script=/usr/lib/python2.6/site-packages/ambari_server/bootstrap.py
-bootstrap.setup_agent.script=/usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
-recommendations.dir=/var/run/ambari-server/stack-recommendations
-stackadvisor.script=/var/lib/ambari-server/resources/scripts/stack_advisor.py
-server.tmp.dir=/var/lib/ambari-server/data/tmp
+metadata.path=$ROOT/var/lib/ambari-server/resources/stacks
+common.services.path=$ROOT/var/lib/ambari-server/resources/common-services
+server.version.file=$ROOT/var/lib/ambari-server/resources/version
+webapp.dir=$ROOT/usr/lib/ambari-server/web
+bootstrap.dir=$ROOT/var/run/ambari-server/bootstrap
+bootstrap.script=$ROOT/usr/lib/python2.6/site-packages/ambari_server/bootstrap.py
+bootstrap.setup_agent.script=$ROOT/usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
+recommendations.dir=$ROOT/var/run/ambari-server/stack-recommendations
+stackadvisor.script=$ROOT/var/lib/ambari-server/resources/scripts/stack_advisor.py
+server.tmp.dir=$ROOT/var/lib/ambari-server/data/tmp
 ambari.python.wrap=ambari-python-wrap
 ambari-server.user=root
 
@@ -69,7 +69,7 @@ server.execution.scheduler.maxDbConnections=5
 server.execution.scheduler.misfire.toleration.minutes=480
 
 # Kerberos settings
-kerberos.keytab.cache.dir = /var/lib/ambari-server/data/cache
+kerberos.keytab.cache.dir = $ROOT/var/lib/ambari-server/data/cache
 
 # Default timeout in seconds before task is killed
 agent.task.timeout=900

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/conf/unix/install-helper.sh
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh
index e2e22ab..0ccfc63 100644
--- a/ambari-server/conf/unix/install-helper.sh
+++ b/ambari-server/conf/unix/install-helper.sh
@@ -30,8 +30,10 @@ COMMON_DIR_SERVER="${ROOT}/usr/lib/ambari-server/lib/ambari_commons"
 RESOURCE_MANAGEMENT_DIR_SERVER="${ROOT}/usr/lib/ambari-server/lib/resource_management"
 JINJA_SERVER_DIR="${ROOT}/usr/lib/ambari-server/lib/ambari_jinja2"
 SIMPLEJSON_SERVER_DIR="${ROOT}/usr/lib/ambari-server/lib/ambari_simplejson"
+AMBARI_PROPERTIES="${ROOT}/etc/ambari-server/conf/ambari.properties"
 
-PYTHON_WRAPER_TARGET="${ROOT}/usr/bin/ambari-python-wrap"
+PYTHON_WRAPER_DIR="${ROOT}/usr/bin/"
+PYTHON_WRAPER_TARGET="${PYTHON_WRAPER_DIR}/ambari-python-wrap"
 
 AMBARI_SERVER_EXECUTABLE_LINK="${ROOT}/usr/sbin/ambari-server"
 AMBARI_SERVER_EXECUTABLE="${ROOT}/etc/init.d/ambari-server"
@@ -80,6 +82,7 @@ do_install(){
   if [ -z "$AMBARI_PYTHON" ] ; then
     >&2 echo "Cannot detect python for ambari to use. Please manually set $PYTHON_WRAPER link to point to correct python binary"
   else
+	mkdir -p "$PYTHON_WRAPER_DIR"
     ln -s "$AMBARI_PYTHON" "$PYTHON_WRAPER_TARGET"
   fi
 
@@ -90,7 +93,7 @@ do_install(){
   which update-rc.d > /dev/null 2>&1
   if [ "$?" -eq 0 ] ; then
     update-rc.d ambari-server defaults
-  fi
+  fi 
 }
 
 do_remove(){

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index b0794c9..0fa0101 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -46,6 +46,7 @@
     <skipPythonTests>false</skipPythonTests>
     <hadoop.version>2.7.1</hadoop.version>
     <jetty.version>9.2.11.v20150529</jetty.version>
+    <empty.dir>src/main/package</empty.dir> <!-- any directory in project with not very big amount of files (not to waste-load them) -->
   </properties>
   <build>
     <plugins>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/sbin/ambari-server
----------------------------------------------------------------------
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index cdda673..5b31d73 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -35,16 +35,23 @@ case "$1" in
         ;;
 esac
 
-export PATH=/usr/lib/ambari-server/*:$PATH:/sbin/:/usr/sbin
-export AMBARI_CONF_DIR=/etc/ambari-server/conf
-PYTHON_WRAP=/usr/bin/ambari-python-wrap
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export ROOT=`dirname $(dirname $SCRIPT_DIR)`
+
+export PATH=$ROOT/usr/lib/ambari-server/*:$PATH:/sbin/:/usr/sbin
+export AMBARI_CONF_DIR=$ROOT/etc/ambari-server/conf
+
+PYTHON_WRAP="$ROOT/usr/bin/ambari-python-wrap"
+AMBARI_ENV="$ROOT/var/lib/ambari-server/ambari-env.sh"
+AMBARI_PYTHON_EXECUTABLE="$ROOT/usr/sbin/ambari-server.py"
+AMBARI_EXECUTABLE="$ROOT/usr/sbin/ambari-server"
 
 if [ -z "$PYTHON" ] ; then
   export PYTHON=`readlink $PYTHON_WRAP`
 fi
 
-if [ -a /var/lib/ambari-server/ambari-env.sh ]; then
-  . /var/lib/ambari-server/ambari-env.sh
+if [ -a "$AMBARI_ENV" ]; then
+  . "$AMBARI_ENV"
 fi
 
 if [ -z "$AMBARI_PASSPHRASE" ]; then
@@ -71,15 +78,15 @@ ret=0
 case "$1" in
   start)
         echo -e "Starting ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   stop)
         echo -e "Stopping ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   reset)
         echo -e "Resetting ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   restart)
         echo -e "Restarting ambari-server"
@@ -88,72 +95,72 @@ case "$1" in
         ;;
   upgrade)
         echo -e "Upgrading ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   status)
         echo -e "Ambari-server status"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   upgradestack)
         echo -e "Upgrading stack of ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup)
         echo -e "Setup ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-jce)
         echo -e "Updating jce policy"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-ldap)
         echo -e "Setting up LDAP properties..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   sync-ldap)
         echo -e "Syncing with LDAP..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   set-current)
         echo -e "Setting current version..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-security)
         echo -e "Security setup options..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   refresh-stack-hash)
         echo -e "Refreshing stack hashes..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   backup)
         echo -e "Backing up Ambari File System state... *this will not backup the server database*"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   restore)
         echo -e "Restoring Ambari File System state"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   update-host-names)
         echo -e "Updating host names"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   check-database)
         echo -e "Checking database"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   enable-stack)
         echo -e "Enabling stack(s)..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-sso)
         echo -e "Setting up SSO authentication properties..."
                 $PYTHON /usr/sbin/ambari-server.py $@
                 ;;
   *)
-        echo "Usage: /usr/sbin/ambari-server
+        echo "Usage: $AMBARI_PYTHON_EXECUTABLE
         {start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database} [options]
-        Use usr/sbin/ambari-server <action> --help to get details on options available.
+        Use $AMBARI_PYTHON_EXECUTABLE <action> --help to get details on options available.
         Or, simply invoke ambari-server.py --help to print the options."
         exit 1
 esac

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/package/deb/control/preinst
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/deb/control/preinst b/ambari-server/src/main/package/deb/control/preinst
index db66d92..9dcd8bf 100644
--- a/ambari-server/src/main/package/deb/control/preinst
+++ b/ambari-server/src/main/package/deb/control/preinst
@@ -37,7 +37,7 @@ SERVER_CONF_SAVE_BACKUP="${AMBARI_ROOT_FOLDER}/etc/ambari-server/conf_$(date '+%
 
 if [ -d "$SERVER_CONF_SAVE" ]
 then
-    mv "$SERVER_CONF_SAVE" "SERVER_CONF_SAVE_BACKUP"
+    mv "$SERVER_CONF_SAVE" "$SERVER_CONF_SAVE_BACKUP"
 fi
 
 if [ -f "$AMBARI_PROPERTIES" ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py
index 935be21..cb7a6cf 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -50,6 +50,7 @@ from ambari_server.setupSecurity import setup_ldap, sync_ldap, setup_master_key,
 from ambari_server.userInput import get_validated_string_input
 
 from ambari_server_main import server_process_main
+from ambari_server.ambariPath import AmbariPath
 
 
 class UserActionPossibleArgs(object):
@@ -326,20 +327,20 @@ def init_parser_options(parser):
 @OsFamilyFuncImpl(OsFamilyImpl.DEFAULT)
 def init_parser_options(parser):
   parser.add_option('-f', '--init-script-file',
-                    default='/var/lib/ambari-server/'
-                            'resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql',
+                    default=AmbariPath.get('/var/lib/ambari-server/'
+                            'resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql'),
                     help="File with setup script")
-  parser.add_option('-r', '--drop-script-file', default="/var/lib/"
+  parser.add_option('-r', '--drop-script-file', default=AmbariPath.get("/var/lib/"
                                                         "ambari-server/resources/"
-                                                        "Ambari-DDL-Postgres-EMBEDDED-DROP.sql",
+                                                        "Ambari-DDL-Postgres-EMBEDDED-DROP.sql"),
                     help="File with drop script")
-  parser.add_option('-u', '--upgrade-script-file', default="/var/lib/"
+  parser.add_option('-u', '--upgrade-script-file', default=AmbariPath.get("/var/lib/"
                                                            "ambari-server/resources/upgrade/ddl/"
-                                                           "Ambari-DDL-Postgres-UPGRADE-1.3.0.sql",
+                                                           "Ambari-DDL-Postgres-UPGRADE-1.3.0.sql"),
                     help="File with upgrade script")
-  parser.add_option('-t', '--upgrade-stack-script-file', default="/var/lib/"
+  parser.add_option('-t', '--upgrade-stack-script-file', default=AmbariPath.get("/var/lib/"
                                                                  "ambari-server/resources/upgrade/dml/"
-                                                                 "Ambari-DML-Postgres-UPGRADE_STACK.sql",
+                                                                 "Ambari-DML-Postgres-UPGRADE_STACK.sql"),
                     help="File with stack upgrade script")
   parser.add_option('-j', '--java-home', default=None,
                     help="Use specified java_home.  Must be valid on all hosts")

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/BackupRestore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/BackupRestore.py b/ambari-server/src/main/python/ambari_server/BackupRestore.py
index 6c6afd2..2c00be9 100644
--- a/ambari-server/src/main/python/ambari_server/BackupRestore.py
+++ b/ambari-server/src/main/python/ambari_server/BackupRestore.py
@@ -21,6 +21,7 @@ limitations under the License.
 import sys
 import zipfile
 import os
+from ambari_server.ambariPath import AmbariPath
 
 # Default values are hardcoded here
 BACKUP_PROCESS = 'backup'
@@ -28,13 +29,13 @@ RESTORE_PROCESS = 'restore'
 SUPPORTED_PROCESSES = [BACKUP_PROCESS, RESTORE_PROCESS]
 
 # The list of files where the ambari server state is kept on the filesystem
-AMBARI_FILESYSTEM_STATE = ["/etc/ambari-server/conf",
-                           "/var/lib/ambari-server/resources",
-                           "/var/run/ambari-server/bootstrap/",
-                           "/var/run/ambari-server/stack-recommendations"]
+AMBARI_FILESYSTEM_STATE = [AmbariPath.get("/etc/ambari-server/conf"),
+                           AmbariPath.get("/var/lib/ambari-server/resources"),
+                           AmbariPath.get("/var/run/ambari-server/bootstrap/"),
+                           AmbariPath.get("/var/run/ambari-server/stack-recommendations")]
 
 # What to use when no path/archive is specified
-DEFAULT_ARCHIVE = "/var/lib/ambari-server/Ambari_State_Backup.zip"
+DEFAULT_ARCHIVE = AmbariPath.get("/var/lib/ambari-server/Ambari_State_Backup.zip")
 
 # Responsible for managing the Backup/Restore process
 class BackupRestore:

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/ambariPath.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/ambariPath.py b/ambari-server/src/main/python/ambari_server/ambariPath.py
new file mode 100644
index 0000000..9d68206
--- /dev/null
+++ b/ambari-server/src/main/python/ambari_server/ambariPath.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Ambari Agent
+
+"""
+
+import os
+
+AMBARI_SERVER_ROOT_ENV_VARIABLE = "ROOT"
+
+class AmbariPath():
+  root_directory = os.environ[AMBARI_SERVER_ROOT_ENV_VARIABLE]
+
+  @staticmethod
+  def get(path):
+    """
+    Any paths which to ambari-server files, should be wrapped with this function call.
+    Which is needed for the situations when ambari-server installed not in / but in other folder like /opt.
+    Not ambari paths like /var/run/postgresql SHOULD NOT wrapped by this call though.
+    """
+    return os.path.realpath(AmbariPath.root_directory + os.sep + path)
+    
+  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
index 4d68300..3ebebae 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -49,6 +49,7 @@ from ambari_server.serverConfiguration import encrypt_password, store_password_f
 
 from ambari_server.userInput import get_YN_input, get_validated_string_input, read_password
 from ambari_server.utils import get_postgre_hba_dir, get_postgre_running_status
+from ambari_server.ambariPath import AmbariPath
 
 ORACLE_DB_ID_TYPES = ["Service Name", "SID"]
 ORACLE_SNAME_PATTERN = "jdbc:oracle:thin:@.+:.+:.+"
@@ -317,7 +318,7 @@ class PGConfig(LinuxDBMSConfig):
                        '--command=psql -f {0} -v stack_name="\'{1}\'"  -v stack_version="\'{2}\'" -v dbname="{3}"']
 
   CHANGE_OWNER_COMMAND = ['su', '-', 'postgres',
-                          '--command=/var/lib/ambari-server/resources/scripts/change_owner.sh -d {0} -s {1} -o {2}']
+                          '--command=' + AmbariPath.get("/var/lib/ambari-server/resources/scripts/change_owner.sh") + ' -d {0} -s {1} -o {2}']
 
   PG_ERROR_BLOCKED = "is being accessed by other users"
   PG_STATUS_RUNNING = None
@@ -339,11 +340,11 @@ class PGConfig(LinuxDBMSConfig):
   PG_HBA_CONF_FILE_BACKUP = None
   POSTGRESQL_CONF_FILE = None
 
-  POSTGRES_EMBEDDED_INIT_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql"
-  POSTGRES_EMBEDDED_DROP_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-DROP.sql"
+  POSTGRES_EMBEDDED_INIT_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql")
+  POSTGRES_EMBEDDED_DROP_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-DROP.sql")
 
-  POSTGRES_INIT_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-CREATE.sql"
-  POSTGRES_DROP_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql"
+  POSTGRES_INIT_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-CREATE.sql")
+  POSTGRES_DROP_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql")
 
   def __init__(self, options, properties, storage_type):
     super(PGConfig, self).__init__(options, properties, storage_type)
@@ -783,8 +784,8 @@ class OracleConfig(LinuxDBMSConfig):
                                    'you must copy the {0} JDBC driver JAR file to {1}.'.format(
         self.dbms_full_name, configDefaults.JAVA_SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql'"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-Oracle-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql'")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Oracle-DROP.sql")
     self.client_tool_usage_pattern = 'sqlplus {1}/{2} < {0}'
 
     self.jdbc_extra_params = [
@@ -894,8 +895,8 @@ class MySQLConfig(LinuxDBMSConfig):
                                      'you must copy the {0} JDBC driver JAR file to {1}.'.format(
     self.dbms_full_name, configDefaults.JAVA_SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-MySQL-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-MySQL-DROP.sql")
     self.client_tool_usage_pattern = 'mysql --user={1} --password={2} {3}<{0}'
 
   #
@@ -914,7 +915,7 @@ class MySQLConfig(LinuxDBMSConfig):
     return True
 
   def _get_remote_script_line(self, scriptFile):
-    MYSQL_INIT_SCRIPT = '/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql'
+    MYSQL_INIT_SCRIPT = AmbariPath.get('/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql')
     MYSQL_EXEC_ARGS_WITH_USER_VARS = "mysql --host={0} --port={1} --user={2} --password={3} {4} " \
                                      "-e\"set @schema=\'{4}\'; set @username=\'{2}\'; source {5};\""
     MYSQL_EXEC_ARGS_WO_USER_VARS = "mysql --force --host={0} --port={1} --user={2} --password={3} --database={4} < {5} 2> /dev/null"
@@ -972,8 +973,8 @@ class MSSQLConfig(LinuxDBMSConfig):
                                    'you must copy the {0} JDBC driver JAR file to {1}.'.format(
       self.dbms_full_name, configDefaults.JAVA_SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-CREATE.sql"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-CREATE.sql")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-DROP.sql")
     self.client_tool_usage_pattern = ''
 
   #
@@ -1029,8 +1030,8 @@ class SQLAConfig(LinuxDBMSConfig):
                                    'you must copy the {0} jdbc client tarball to {1}.'.format(
       self.dbms_full_name, configDefaults.SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-CREATE.sql"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-CREATE.sql")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-DROP.sql")
     self.client_tool_usage_pattern = 'stub string'
 
   #

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/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 dfb1791..3df1663 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -38,6 +38,7 @@ from ambari_commons.logging_utils import get_debug_mode, print_info_msg, print_w
 from ambari_server.properties import Properties
 from ambari_server.userInput import get_validated_string_input
 from ambari_server.utils import compare_versions, locate_file
+from ambari_server.ambariPath import AmbariPath
 
 
 OS_VERSION = OSCheck().get_os_major_version()
@@ -281,7 +282,7 @@ class ServerConfigDefaults(object):
   def __init__(self):
     self.JAVA_SHARE_PATH = "/usr/share/java"
     self.SHARE_PATH = "/usr/share"
-    self.OUT_DIR = os.sep + os.path.join("var", "log", "ambari-server")
+    self.OUT_DIR = AmbariPath.get(os.sep + os.path.join("var", "log", "ambari-server"))
     self.SERVER_OUT_FILE = os.path.join(self.OUT_DIR, "ambari-server.out")
     self.SERVER_LOG_FILE = os.path.join(self.OUT_DIR, "ambari-server.log")
     self.ROOT_FS_PATH = os.sep
@@ -294,7 +295,7 @@ class ServerConfigDefaults(object):
 
     # Configuration defaults
     self.DEFAULT_CONF_DIR = ""
-    self.PID_DIR = os.sep + os.path.join("var", "run", "ambari-server")
+    self.PID_DIR = AmbariPath.get(os.sep + os.path.join("var", "run", "ambari-server"))
     self.DEFAULT_LIBS_DIR = ""
     self.DEFAULT_VLIBS_DIR = ""
 
@@ -395,9 +396,9 @@ class ServerConfigDefaultsLinux(ServerConfigDefaults):
     self.JAVA_EXE_SUBPATH = "bin/java"
 
     # Configuration defaults
-    self.DEFAULT_CONF_DIR = "/etc/ambari-server/conf"
-    self.DEFAULT_LIBS_DIR = "/usr/lib/ambari-server"
-    self.DEFAULT_VLIBS_DIR = "/var/lib/ambari-server"
+    self.DEFAULT_CONF_DIR = AmbariPath.get("/etc/ambari-server/conf")
+    self.DEFAULT_LIBS_DIR = AmbariPath.get("/usr/lib/ambari-server")
+    self.DEFAULT_VLIBS_DIR = AmbariPath.get("/var/lib/ambari-server")
 
     self.AMBARI_PROPERTIES_BACKUP_FILE = "ambari.properties.rpmsave"
     self.AMBARI_ENV_BACKUP_FILE = "ambari-env.sh.rpmsave"
@@ -407,55 +408,55 @@ class ServerConfigDefaultsLinux(ServerConfigDefaults):
     # Rules are executed in the same order as they are listed
     # {0} in user/group will be replaced by customized ambari-server username
     self.NR_ADJUST_OWNERSHIP_LIST = [
-      ("/var/log/ambari-server/", "644", "{0}", True),
-      ("/var/log/ambari-server/", "755", "{0}", False),
-      ("/var/run/ambari-server/", "644", "{0}", True),
-      ("/var/run/ambari-server/", "755", "{0}", False),
-      ("/var/run/ambari-server/bootstrap", "755", "{0}", False),
-      ("/var/lib/ambari-server/ambari-env.sh", "700", "{0}", False),
-      ("/var/lib/ambari-server/ambari-sudo.sh", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/", "600", "{0}", True),
-      ("/var/lib/ambari-server/keys/", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/db/", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/db/newcerts/", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/.ssh", "700", "{0}", False),
-      ("/var/lib/ambari-server/resources/common-services/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/stacks/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/custom_actions/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/host_scripts/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/views/", "644", "{0}", True),
-      ("/var/lib/ambari-server/resources/views/", "755", "{0}", False),
-      ("/var/lib/ambari-server/resources/views/work/", "755", "{0}", True),
-      ("/etc/ambari-server/conf/", "644", "{0}", True),
-      ("/etc/ambari-server/conf/", "755", "{0}", False),
-      ("/etc/ambari-server/conf/password.dat", "640", "{0}", False),
-      ("/var/lib/ambari-server/keys/pass.txt", "600", "{0}", False),
-      ("/etc/ambari-server/conf/ldap-password.dat", "640", "{0}", False),
-      ("/var/run/ambari-server/stack-recommendations/", "744", "{0}", True),
-      ("/var/run/ambari-server/stack-recommendations/", "755", "{0}", False),
-      ("/var/lib/ambari-server/resources/data/", "644", "{0}", False),
-      ("/var/lib/ambari-server/resources/data/", "755", "{0}", False),
-      ("/var/lib/ambari-server/data/tmp/", "644", "{0}", True),
-      ("/var/lib/ambari-server/data/tmp/", "755", "{0}", False),
-      ("/var/lib/ambari-server/data/cache/", "600", "{0}", True),
-      ("/var/lib/ambari-server/data/cache/", "700", "{0}", False),
+      (AmbariPath.get("/var/log/ambari-server/"), "644", "{0}", True),
+      (AmbariPath.get("/var/log/ambari-server/"), "755", "{0}", False),
+      (AmbariPath.get("/var/run/ambari-server/"), "644", "{0}", True),
+      (AmbariPath.get("/var/run/ambari-server/"), "755", "{0}", False),
+      (AmbariPath.get("/var/run/ambari-server/bootstrap"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/ambari-env.sh"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/ambari-sudo.sh"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/"), "600", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/keys/"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/db/"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/db/newcerts/"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/.ssh"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/common-services/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/stacks/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/custom_actions/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/host_scripts/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/views/"), "644", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/views/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/views/work/"), "755", "{0}", True),
+      (AmbariPath.get("/etc/ambari-server/conf/"), "644", "{0}", True),
+      (AmbariPath.get("/etc/ambari-server/conf/"), "755", "{0}", False),
+      (AmbariPath.get("/etc/ambari-server/conf/password.dat"), "640", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/pass.txt"), "600", "{0}", False),
+      (AmbariPath.get("/etc/ambari-server/conf/ldap-password.dat"), "640", "{0}", False),
+      (AmbariPath.get("/var/run/ambari-server/stack-recommendations/"), "744", "{0}", True),
+      (AmbariPath.get("/var/run/ambari-server/stack-recommendations/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/data/"), "644", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/data/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/data/tmp/"), "644", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/data/tmp/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/data/cache/"), "600", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/data/cache/"), "700", "{0}", False),
       # Also, /etc/ambari-server/conf/password.dat
       # is generated later at store_password_file
     ]
     self.NR_CHANGE_OWNERSHIP_LIST = [
-      ("/var/lib/ambari-server", "{0}", True),
-      ("/usr/lib/ambari-server", "{0}", True),
-      ("/var/log/ambari-server", "{0}", True),
-      ("/var/run/ambari-server", "{0}", True),
-      ("/etc/ambari-server", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server"), "{0}", True),
+      (AmbariPath.get("/usr/lib/ambari-server"), "{0}", True),
+      (AmbariPath.get("/var/log/ambari-server"), "{0}", True),
+      (AmbariPath.get("/var/run/ambari-server"), "{0}", True),
+      (AmbariPath.get("/etc/ambari-server"), "{0}", True),
     ]
     self.NR_USERADD_CMD = 'useradd -M --comment "{1}" ' \
-                 '--shell %s -d /var/lib/ambari-server/keys/ {0}' % locate_file('nologin', '/sbin')
+                 '--shell %s ' % locate_file('nologin', '/sbin') + ' -d ' + AmbariPath.get('/var/lib/ambari-server/keys/') + ' {0}'
 
-    self.SERVER_RESOURCES_DIR = "/var/lib/ambari-server/resources"
-    self.STACK_LOCATION_DEFAULT = "/var/lib/ambari-server/resources/stacks"
+    self.SERVER_RESOURCES_DIR = AmbariPath.get("/var/lib/ambari-server/resources")
+    self.STACK_LOCATION_DEFAULT = AmbariPath.get("/var/lib/ambari-server/resources/stacks")
 
-    self.DEFAULT_VIEWS_DIR = "/var/lib/ambari-server/resources/views"
+    self.DEFAULT_VIEWS_DIR = AmbariPath.get("/var/lib/ambari-server/resources/views")
 
     #keytool commands
     self.keytool_bin_subpath = "bin/keytool"
@@ -523,6 +524,10 @@ def get_ambari_properties():
     properties = Properties()
     with open(conf_file) as hfR:
       properties.load(hfR)
+      
+    for k,v in properties.iteritems():
+      properties.__dict__[k] = v.replace("$ROOT", os.environ["ROOT"])
+      properties._props[k] = v.replace("$ROOT", os.environ["ROOT"])
   except (Exception), e:
     print 'Could not read "%s": %s' % (conf_file, e)
     return -1
@@ -571,7 +576,7 @@ def get_value_from_properties(properties, key, default=""):
 def get_views_dir(properties):
   views_dir = properties.get_property(VIEWS_DIR_PROPERTY)
   if views_dir is None or views_dir == "":
-    views_dirs = glob.glob("/var/lib/ambari-server/resources/views/work")
+    views_dirs = glob.glob(AmbariPath.get("/var/lib/ambari-server/resources/views/work"))
   else:
     views_dirs = glob.glob(views_dir + "/work")
   return views_dirs
@@ -579,7 +584,7 @@ def get_views_dir(properties):
 def get_admin_views_dir(properties):
   views_dir = properties.get_property(VIEWS_DIR_PROPERTY)
   if views_dir is None or views_dir == "":
-    views_dirs = glob.glob("/var/lib/ambari-server/resources/views/work/ADMIN_VIEW*")
+    views_dirs = glob.glob(AmbariPath.get("/var/lib/ambari-server/resources/views/work/ADMIN_VIEW*"))
   else:
     views_dirs = glob.glob(views_dir + "/work/ADMIN_VIEW*")
   return views_dirs
@@ -599,7 +604,7 @@ def get_is_persisted(properties):
 def get_credential_store_location(properties):
   store_loc = properties[SECURITY_KEYS_DIR]
   if store_loc is None or store_loc == "":
-    store_loc = "/var/lib/ambari-server/keys/credentials.jceks"
+    store_loc = AmbariPath.get("/var/lib/ambari-server/keys/credentials.jceks")
   else:
     store_loc += os.sep + "credentials.jceks"
   return store_loc

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/serverSetup.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py
index c370257..643aebd 100644
--- a/ambari-server/src/main/python/ambari_server/serverSetup.py
+++ b/ambari-server/src/main/python/ambari_server/serverSetup.py
@@ -45,7 +45,7 @@ from ambari_server.setupSecurity import adjust_directory_permissions
 from ambari_server.userInput import get_YN_input, get_validated_string_input
 from ambari_server.utils import locate_file
 from ambari_server.serverClassPath import ServerClassPath
-
+from ambari_server.ambariPath import AmbariPath
 
 # selinux commands
 GET_SE_LINUX_ST_CMD = locate_file('sestatus', '/usr/sbin')
@@ -310,7 +310,7 @@ class AmbariUserChecksLinux(AmbariUserChecks):
     self.NR_DEFAULT_USER = "root"
 
     self.NR_USERADD_CMD = 'useradd -M --comment "{1}" ' \
-                          '--shell %s -d /var/lib/ambari-server/keys/ {0}' % locate_file('nologin', '/sbin')
+                          '--shell %s ' % locate_file('nologin', '/sbin') + '-d ' + AmbariPath.get('/var/lib/ambari-server/keys/') + ' {0}'
 
   def _create_custom_user(self):
     user = get_validated_string_input(
@@ -960,7 +960,7 @@ def _reset_database(options):
   if persistence_type == "remote":
       err = 'Ambari doesn\'t support resetting exernal DB automatically. ' \
             'To reset Ambari Server schema you must first drop and then create it ' \
-            'using DDL scripts from "/var/lib/ambari-server/resources/"'
+            'using DDL scripts from "{0}"'.format(AmbariPath.get("/var/lib/ambari-server/resources/"))
       raise FatalException(1, err)
   else:
     factory = DBMSConfigFactory()

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py
index f52edc3..6c19d5e 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -45,6 +45,7 @@ with patch("platform.linux_distribution", return_value = os_distro_value):
   with patch("os.symlink"):
     with patch("__builtin__.open"):
       with patch("glob.glob", return_value = ['/etc/init.d/postgresql-9.3']):
+        os.environ["ROOT"] = ""
         _ambari_server_ = __import__('ambari-server')
 
         from ambari_commons.firewall import Firewall
@@ -6622,7 +6623,6 @@ class TestAmbariServer(TestCase):
     dbms = OracleConfig(args, properties, "local")
 
     self.assertTrue(decrypt_password_for_alias_method.called)
-    self.assertFalse(path_isabs_method.called)
     self.assertEquals("fakeuser", dbms.database_username)
     self.assertEquals("falepasswd", dbms.database_password)