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 2018/08/16 10:16:33 UTC

[ambari] branch branch-2.7 updated: AMBARI-24488. Ambari Server Upgrade is failing with IndexError: tuple index out of range while running ambari-server upgrade command. (aonishuk)

This is an automated email from the ASF dual-hosted git repository.

aonishuk pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 81aa4db  AMBARI-24488. Ambari Server Upgrade is failing with IndexError: tuple index out of range while running ambari-server upgrade command. (aonishuk)
81aa4db is described below

commit 81aa4dbc7b6fd086af28e9f6c70ef5616b478f63
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Thu Aug 16 11:33:56 2018 +0300

    AMBARI-24488. Ambari Server Upgrade is failing with IndexError: tuple index out of range while running ambari-server upgrade command. (aonishuk)
---
 ambari-agent/src/main/package/deb/control/preinst                  | 2 +-
 ambari-agent/src/main/package/rpm/preinstall.sh                    | 2 +-
 ambari-server/src/main/package/deb/control/preinst                 | 4 ++--
 ambari-server/src/main/package/rpm/preinstall.sh                   | 6 +++---
 ambari-server/src/main/python/ambari_server/serverConfiguration.py | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ambari-agent/src/main/package/deb/control/preinst b/ambari-agent/src/main/package/deb/control/preinst
index ad6153f..7bbb73e 100644
--- a/ambari-agent/src/main/package/deb/control/preinst
+++ b/ambari-agent/src/main/package/deb/control/preinst
@@ -26,7 +26,7 @@ common services folder::${var_dir}/cache/common-services:${var_dir}/cache/common
 ambari-agent.ini::${etc_dir}/conf/ambari-agent.ini:${etc_dir}/conf/ambari-agent.ini.old
 sudoers:Please restore the file if you were using it for ambari-agent non-root functionality:${sudoers_dir}/ambari-agent:${sudoers_dir}/ambari-agent.bak"
 
-  echo ${backup_folders} | while IFS=: read title notes source target; do
+  echo "${backup_folders}" | while IFS=: read title notes source target; do
     if [ -d "${source}" ] || [ -f "${source}" ]; then
       echo -n "Moving ${title}: ${source} -> ${target}"
       if [ ! -z notes ]; then
diff --git a/ambari-agent/src/main/package/rpm/preinstall.sh b/ambari-agent/src/main/package/rpm/preinstall.sh
index ff6dd3c..5454cdf 100644
--- a/ambari-agent/src/main/package/rpm/preinstall.sh
+++ b/ambari-agent/src/main/package/rpm/preinstall.sh
@@ -26,7 +26,7 @@ ambari-agent.ini::${etc_dir}/conf/ambari-agent.ini:${etc_dir}/conf/ambari-agent.
 sudoers:Please restore the file if you were using it for ambari-agent non-root functionality:${sudoers_dir}/ambari-agent:${sudoers_dir}/ambari-agent.bak"
 
   echo "${backup_folders}" | while IFS=: read title notes source target; do
-    if [ -d "${source}" ] || [ -f "${source}" ]; then
+    if [ -e "${source}" ]; then
       echo -n "Moving ${title}: ${source} -> ${target}"
 
       if [ ! -z ${notes} ]; then
diff --git a/ambari-server/src/main/package/deb/control/preinst b/ambari-server/src/main/package/deb/control/preinst
index 5b7841b..fc9bfe1 100644
--- a/ambari-server/src/main/package/deb/control/preinst
+++ b/ambari-server/src/main/package/deb/control/preinst
@@ -29,14 +29,14 @@ do_backups(){
 
   # data format:  "title:source:destination"; each new record on new line
   local backup_folders="configs:${etc_dir}/conf.save:${etc_dir}/conf_$(date '+%d_%m_%y_%H_%M').save
-Ambari properties:${etc_dir}/conf/ambari.properties:${etc_dir}/conf/ambari.propertie.rpmsave
+Ambari properties:${etc_dir}/conf/ambari.properties:${etc_dir}/conf/ambari.properties.rpmsave
 Ambari properties:${var_dir}/ambari-env.sh:${var_dir}/ambari-env.sh.rpmsave
 JAAS login file:${etc_dir}/conf/krb5JAASLogin.conf:${etc_dir}/conf/krb5JAASLogin.conf.rpmsave
 stacks directory:${var_dir}/resources/stacks:${stacks_backup_folder}
 common-services directory:${var_dir}/resources/common-services:${common_service_backup_folder}"
 
  echo "${backup_folders}"| while IFS=: read title source destination; do
-   if [ -d "${source}" ]; then
+   if [ -e "${source}" ]; then
      echo "Backing up ${title}: ${source} -> ${destination}"
      mv -f "${source}" "${destination}"
    fi
diff --git a/ambari-server/src/main/package/rpm/preinstall.sh b/ambari-server/src/main/package/rpm/preinstall.sh
index 5b7841b..ad0909c 100644
--- a/ambari-server/src/main/package/rpm/preinstall.sh
+++ b/ambari-server/src/main/package/rpm/preinstall.sh
@@ -29,14 +29,14 @@ do_backups(){
 
   # data format:  "title:source:destination"; each new record on new line
   local backup_folders="configs:${etc_dir}/conf.save:${etc_dir}/conf_$(date '+%d_%m_%y_%H_%M').save
-Ambari properties:${etc_dir}/conf/ambari.properties:${etc_dir}/conf/ambari.propertie.rpmsave
+Ambari properties:${etc_dir}/conf/ambari.properties:${etc_dir}/conf/ambari.properties.rpmsave
 Ambari properties:${var_dir}/ambari-env.sh:${var_dir}/ambari-env.sh.rpmsave
 JAAS login file:${etc_dir}/conf/krb5JAASLogin.conf:${etc_dir}/conf/krb5JAASLogin.conf.rpmsave
 stacks directory:${var_dir}/resources/stacks:${stacks_backup_folder}
 common-services directory:${var_dir}/resources/common-services:${common_service_backup_folder}"
 
  echo "${backup_folders}"| while IFS=: read title source destination; do
-   if [ -d "${source}" ]; then
+   if [ -e "${source}" ]; then
      echo "Backing up ${title}: ${source} -> ${destination}"
      mv -f "${source}" "${destination}"
    fi
@@ -103,4 +103,4 @@ common-services directory:${var_dir}/resources/common-services:${common_service_
   done
 }
 
-do_backups
\ No newline at end of file
+do_backups
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index d34a5ca..ca140d4 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -840,7 +840,7 @@ def update_database_name_property(upgrade=False):
     if properties == -1:
       err = "Error getting ambari properties"
       raise FatalException(-1, err)
-    print_warning_msg("{0} property isn't set in {1} . Setting it to default value - {3}".format(JDBC_DATABASE_NAME_PROPERTY, AMBARI_PROPERTIES_FILE, configDefaults.DEFAULT_DB_NAME))
+    print_warning_msg("{0} property isn't set in {1} . Setting it to default value - {2}".format(JDBC_DATABASE_NAME_PROPERTY, AMBARI_PROPERTIES_FILE, configDefaults.DEFAULT_DB_NAME))
     properties.process_pair(JDBC_DATABASE_NAME_PROPERTY, configDefaults.DEFAULT_DB_NAME)
     conf_file = find_properties_file()
     try: