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 2020/02/10 10:36:35 UTC
[ambari-infra] branch master updated: AMBARI-25473 Upgrade Infra
Solr Clients fails if it is installed on only one host (santal via
oleewere)
This is an automated email from the ASF dual-hosted git repository.
oleewere pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-infra.git
The following commit(s) were added to refs/heads/master by this push:
new de3edc5 AMBARI-25473 Upgrade Infra Solr Clients fails if it is installed on only one host (santal via oleewere)
de3edc5 is described below
commit de3edc577467d03d0156850b217320530479e2c4
Author: Szilard Antal <sa...@cloudera.com>
AuthorDate: Mon Feb 10 11:36:18 2020 +0100
AMBARI-25473 Upgrade Infra Solr Clients fails if it is installed on only one host (santal via oleewere)
---
ambari-infra-solr-client/src/main/python/migrationHelper.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ambari-infra-solr-client/src/main/python/migrationHelper.py b/ambari-infra-solr-client/src/main/python/migrationHelper.py
index e44044c..a257b34 100755
--- a/ambari-infra-solr-client/src/main/python/migrationHelper.py
+++ b/ambari-infra-solr-client/src/main/python/migrationHelper.py
@@ -508,6 +508,11 @@ def upgrade_solr_clients(options, accessor, parser, config):
host = socket.gethostname()
if host in solr_client_hosts:
solr_client_hosts.remove(host)
+
+ if not len(solr_client_hosts):
+ print 'The Solr Clients upgrade request has been aborted because no other host can be upgraded.'
+ sys.exit(0)
+
context = "Upgrade Solr Clients"
sys.stdout.write("Sending upgrade request: [{0}] ".format(context))
sys.stdout.flush()
@@ -2078,4 +2083,4 @@ if __name__=="__main__":
print 30 * "-"
print "Command elapsed time: {0}".format(time_to_print)
print 30 * "-"
- print "Migration helper command {0}FINISHED{1}".format(colors.OKGREEN, colors.ENDC)
\ No newline at end of file
+ print "Migration helper command {0}FINISHED{1}".format(colors.OKGREEN, colors.ENDC)