ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adorosz...@apache.org
Subject [ambari] branch trunk updated: AMBARI-23352. During ambari upgrade, DB backup choice default option should be n instead of y (#775)
Date Tue, 27 Mar 2018 20:23:46 GMT
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 147b36a  AMBARI-23352. During ambari upgrade, DB backup choice default option should
be n instead of y (#775)
147b36a is described below

commit 147b36a16370df8ef3a73656df6ef06470c2b591
Author: Jay Kumar SenSharma <jaysensharma@users.noreply.github.com>
AuthorDate: Wed Mar 28 07:23:44 2018 +1100

    AMBARI-23352. During ambari upgrade, DB backup choice default option should be n instead
of y (#775)
---
 ambari-server/src/main/python/ambari_server/serverUpgrade.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ambari-server/src/main/python/ambari_server/serverUpgrade.py b/ambari-server/src/main/python/ambari_server/serverUpgrade.py
index 31ce9d0..cbc0bc1 100644
--- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py
+++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py
@@ -50,7 +50,7 @@ from ambari_server.serverUtils import is_server_runing, get_ambari_server_api_ba
 from ambari_server.userInput import get_validated_string_input, get_prompt_default, read_password,
get_YN_input
 from ambari_server.serverClassPath import ServerClassPath
 from ambari_server.setupMpacks import replay_mpack_logs
-from ambari_commons.logging_utils import get_debug_mode,   set_debug_mode_from_options
+from ambari_commons.logging_utils import get_debug_mode, set_debug_mode_from_options, get_silent
 
 logger = logging.getLogger(__name__)
 
@@ -123,8 +123,11 @@ def change_objects_owner(args):
 
 def run_schema_upgrade(args):
   db_title = get_db_type(get_ambari_properties()).title
+  silent = get_silent()
+  default_answer = 'y' if silent else 'n'
+  default_value = silent
   confirm = get_YN_input("Ambari Server configured for %s. Confirm "
-                        "you have made a backup of the Ambari Server database [y/n] (y)?
" % db_title, True)
+                         "you have made a backup of the Ambari Server database [y/n] (%s)?
" % (db_title, default_answer), default_value)
 
   if not confirm:
     print_error_msg("Database backup is not confirmed")

-- 
To stop receiving notification emails like this one, please contact
adoroszlai@apache.org.

Mime
View raw message