ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/2] ambari git commit: AMBARI-16711. hostname start to have localhost value in ambari-agent.ini file after upgrade from 2.2.0.0 to 2.4.0.0 (aonishuk)
Date Tue, 17 May 2016 20:58:37 GMT
AMBARI-16711. hostname start to  have localhost value  in ambari-agent.ini file after upgrade
from 2.2.0.0 to 2.4.0.0 (aonishuk)


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

Branch: refs/heads/branch-2.4
Commit: 6bd63226c17a1f4d7a6bca1de30ee43523f2c334
Parents: 8bf7c2b
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue May 17 23:57:28 2016 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue May 17 23:57:28 2016 +0300

----------------------------------------------------------------------
 ambari-agent/conf/unix/install-helper.sh | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd63226/ambari-agent/conf/unix/install-helper.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/install-helper.sh b/ambari-agent/conf/unix/install-helper.sh
index 8a5e1f1..3614659 100644
--- a/ambari-agent/conf/unix/install-helper.sh
+++ b/ambari-agent/conf/unix/install-helper.sh
@@ -85,16 +85,6 @@ do_install(){
     update-rc.d ambari-agent defaults
   fi
 
-  BAK=/etc/ambari-agent/conf/ambari-agent.ini.old
-  ORIG=/etc/ambari-agent/conf/ambari-agent.ini
-
-  if [ -f $BAK ]; then
-    if [ -f "/var/lib/ambari-agent/upgrade_agent_configs.py" ]; then
-      /var/lib/ambari-agent/upgrade_agent_configs.py
-    fi
-    mv $BAK ${BAK}_$(date '+%d_%m_%y_%H_%M').save
-  fi
-
   # remove old python wrapper
   rm -f "$PYTHON_WRAPER_TARGET"
 
@@ -110,10 +100,22 @@ do_install(){
     fi
   done
 
+  BAK=/etc/ambari-agent/conf/ambari-agent.ini.old
+  ORIG=/etc/ambari-agent/conf/ambari-agent.ini
+  UPGRADE_AGENT_CONFIGS_SCRIPT=/var/lib/ambari-agent/upgrade_agent_configs.py
+
   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"
+    >&2 echo "Cannot detect python for Ambari to use. Please manually set $PYTHON_WRAPER_TARGET
link to point to correct python binary"
+    >&2 echo "Cannot upgrade agent configs because python for Ambari is not configured.
The old config file is saved as $BAK . Execution of $UPGRADE_AGENT_CONFIGS_SCRIPT was skipped."
   else
     ln -s "$AMBARI_PYTHON" "$PYTHON_WRAPER_TARGET"
+
+    if [ -f $BAK ]; then
+      if [ -f "$UPGRADE_AGENT_CONFIGS_SCRIPT" ]; then
+        $UPGRADE_AGENT_CONFIGS_SCRIPT
+      fi
+      mv $BAK ${BAK}_$(date '+%d_%m_%y_%H_%M').save
+    fi
   fi
 }
 


Mime
View raw message