ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [20/26] incubator-ranger git commit: RANGER-500 - Check for url property also
Date Sat, 23 May 2015 02:05:54 GMT
RANGER-500 - Check for url property also

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

Branch: refs/heads/tag-policy
Commit: 54caee221cb7a04b8b61d857464d1faf66ac9830
Parents: d04a9a2
Author: Don Bosco Durai <bosco@apache.org>
Authored: Thu May 21 01:05:58 2015 -0700
Committer: Don Bosco Durai <bosco@apache.org>
Committed: Thu May 21 01:05:58 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/ranger/solr/SolrMgr.java | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/54caee22/security-admin/src/main/java/org/apache/ranger/solr/SolrMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/solr/SolrMgr.java b/security-admin/src/main/java/org/apache/ranger/solr/SolrMgr.java
index ee52992..2a57fa1 100644
--- a/security-admin/src/main/java/org/apache/ranger/solr/SolrMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/solr/SolrMgr.java
@@ -48,6 +48,8 @@ public class SolrMgr {
 	Date lastConnectTime = null;
 	volatile boolean initDone = false;
 
+	final static String SOLR_URLS_PROP = "ranger.audit.solr.urls";
+
 	public SolrMgr() {
 
 	}
@@ -58,16 +60,22 @@ public class SolrMgr {
 				if (!initDone) {
 					if (rangerBizUtil.getAuditDBType().equalsIgnoreCase("solr")) {
 						String solrURL = PropertiesUtil
-								.getProperty("ranger.audit.solr.urls");
+								.getProperty(SOLR_URLS_PROP);
 
 						if (solrURL == null) {
-							//Let's try older property name
+							// Try with url
+							solrURL = PropertiesUtil
+									.getProperty("ranger.audit.solr.url");
+						}
+						if (solrURL == null) {
+							// Let's try older property name
 							solrURL = PropertiesUtil
 									.getProperty("ranger.solr.url");
 						}
 						if (solrURL == null || solrURL.isEmpty()
 								|| solrURL.equalsIgnoreCase("none")) {
-							logger.fatal("Solr URL for Audit is empty");
+							logger.fatal("Solr URL for Audit is empty. Please set property "
+									+ SOLR_URLS_PROP);
 						} else {
 							try {
 								solrClient = new HttpSolrClient(solrURL);


Mime
View raw message