hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [3/3] incubator-hawq git commit: HAWQ-254. User should only confirm once during hawq init standby.
Date Thu, 17 Dec 2015 03:42:20 GMT
HAWQ-254. User should only confirm once during hawq init standby.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/d9e1578c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/d9e1578c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/d9e1578c

Branch: refs/heads/master
Commit: d9e1578c4123f45189f0685e0e7721d6fe39e2b5
Parents: 0562d56
Author: rlei <rlei@pivotal.io>
Authored: Thu Dec 17 11:31:36 2015 +0800
Committer: rlei <rlei@pivotal.io>
Committed: Thu Dec 17 11:41:28 2015 +0800

----------------------------------------------------------------------
 tools/bin/hawq_ctl | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d9e1578c/tools/bin/hawq_ctl
----------------------------------------------------------------------
diff --git a/tools/bin/hawq_ctl b/tools/bin/hawq_ctl
index e49eff0..4c0652a 100755
--- a/tools/bin/hawq_ctl
+++ b/tools/bin/hawq_ctl
@@ -57,7 +57,6 @@ class HawqInit:
         self.hawq_dict = hawq_dict
         self.locale = opts.hawq_locale
         self.quiet  = opts.quiet_run
-        self.prompt = opts.prompt
         self.hawq_lc_collate= opts.hawq_lc_collate
         self.hawq_lc_ctype = opts.hawq_lc_ctype
         self.hawq_lc_messages = opts.hawq_lc_messages
@@ -345,9 +344,6 @@ class HawqInit:
             logger.info("Try to remove standby master")
             self.hawq_remove_standby()
         elif self.node_type == "standby":
-            if self.prompt:
-                if not userinput.ask_yesno(None, "\nMaster will be restarted, continue",
'N'):
-                    sys.exit(1)
             if self.standby_host_name.lower() in ('', 'none'):
                 logger.info("No standby host found")
                 logger.info("Please check your standby host name")
@@ -1048,8 +1044,13 @@ if __name__ == '__main__':
     elif opts.hawq_command == 'restart':
         restart_hawq(opts, hawq_dict)
     elif opts.hawq_command == 'init':
+        if opts.node_type == 'standby':
+            warn_msg = "\nMaster will get restarted, continue with standby init"
+        else:
+            warn_msg = "\nContinue with HAWQ init"
+
         if opts.prompt:
-            if not userinput.ask_yesno(None, "\nContinue with HAWQ init", 'N'):
+            if not userinput.ask_yesno(None, warn_msg, 'N'):
                 sys.exit(1)
         hawq_init(opts, hawq_dict)
     elif opts.hawq_command == 'activate':


Mime
View raw message