You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2018/06/26 20:25:44 UTC

[ambari] branch trunk updated: AMBARI-23945. Add warning for migration config generation (if wrong host is used)

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

oleewere 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 cf17293  AMBARI-23945. Add warning for migration config generation (if wrong host is used)
cf17293 is described below

commit cf172934898929be9aa3839da820580af7b36715
Author: Oliver Szabo <ol...@gmail.com>
AuthorDate: Tue Jun 26 22:05:29 2018 +0200

    AMBARI-23945. Add warning for migration config generation (if wrong host is used)
---
 .../src/main/python/migrationConfigGenerator.py                    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
index b8e45f9..51614ea 100755
--- a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
+++ b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
@@ -59,7 +59,7 @@ logger.addHandler(handler)
 
 class colors:
   OKGREEN = '\033[92m'
-  WARNING = '\033[93m'
+  WARNING = '\033[38;5;214m'
   FAIL = '\033[91m'
   ENDC = '\033[0m'
 
@@ -282,6 +282,11 @@ def generate_ambari_solr_migration_ini_file(options, accessor, protocol):
 
   cluster_config = get_cluster_configs(blueprint)
   solr_hosts = get_solr_hosts(options, accessor)
+
+  if solr_hosts and host not in solr_hosts:
+    print "{0}WARNING{1}: Host '{2}' is not found in Infra Solr hosts ({3}). Migration commands won't work from here."\
+      .format(colors.WARNING, colors.ENDC, host, ','.join(solr_hosts))
+
   zookeeper_hosts = get_zookeeper_server_hosts(options, accessor)
 
   security_enabled = is_security_enabled(cluster_config)