This is an automated email from the ASF dual-hosted git repository.
oleewere 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 f2f2117 AMBARI-25473 Upgrade Infra Solr Clients fails if it is
installed on only one host (santal) (#3178)
f2f2117 is described below
commit f2f21177a78e9b0a793233a58a78ac1fa7d01e1d
Author: Szilárd Antal <[email protected]>
AuthorDate: Sun Feb 9 16:21:44 2020 +0100
AMBARI-25473 Upgrade Infra Solr Clients fails if it is installed on only
one host (santal) (#3178)
---
.../ambari-infra-solr-client/src/main/python/migrationHelper.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git
a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationHelper.py
b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationHelper.py
index 2aba85c..bf664dc 100755
--- a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationHelper.py
+++ b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationHelper.py
@@ -509,6 +509,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()