ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-92:Fixed typo in message and updated error messages
Date Fri, 10 Oct 2014 03:22:29 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 5dfd15e3c -> fa1aaa5b7


ARGUS-92:Fixed typo in message and updated error messages

Signed-off-by: sneethiraj <sneethir@apache.org>


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

Branch: refs/heads/master
Commit: fa1aaa5b7349d1b81c6d46ae1d380a4ce4e7926c
Parents: 5dfd15e
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Thu Oct 9 16:38:45 2014 -0400
Committer: sneethiraj <sneethir@apache.org>
Committed: Thu Oct 9 23:22:03 2014 -0400

----------------------------------------------------------------------
 .../com/xasecure/hadoop/client/HadoopFS.java    |  2 +-
 .../hadoop/client/config/BaseClient.java        |  6 +--
 .../com/xasecure/hbase/client/HBaseClient.java  |  2 +-
 .../com/xasecure/hive/client/HiveClient.java    |  2 +-
 .../com/xasecure/knox/client/KnoxClient.java    | 39 +++++++-------------
 .../com/xasecure/storm/client/StormClient.java  |  2 +-
 .../main/java/com/xasecure/biz/AssetMgr.java    |  3 ++
 .../webapp/scripts/views/asset/AssetCreate.js   |  4 +-
 security-admin/src/main/webapp/styles/xa.css    |  4 ++
 9 files changed, 30 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/lookup-client/src/main/java/com/xasecure/hadoop/client/HadoopFS.java
----------------------------------------------------------------------
diff --git a/lookup-client/src/main/java/com/xasecure/hadoop/client/HadoopFS.java b/lookup-client/src/main/java/com/xasecure/hadoop/client/HadoopFS.java
index 4ae07fc..69c5578 100644
--- a/lookup-client/src/main/java/com/xasecure/hadoop/client/HadoopFS.java
+++ b/lookup-client/src/main/java/com/xasecure/hadoop/client/HadoopFS.java
@@ -180,7 +180,7 @@ public class HadoopFS extends BaseClient {
 			generateResponseDataMap(connectivityStatus, successMsg, successMsg,
 					null, null, responseData);
 		} else {
-			String failureMsg = "Unable to retrive any files using given parameters, "
+			String failureMsg = "Unable to retrieve any files using given parameters, "
 					+ "You can still save the repository and start creating policies, "
 					+ "but you would not be able to use autocomplete for resource names. "
 					+ "Check xa_portal.log for more info.";

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
----------------------------------------------------------------------
diff --git a/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
b/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
index 1f8ae47..43f94e4 100644
--- a/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
+++ b/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
@@ -151,12 +151,12 @@ public abstract class BaseClient {
 	public static String getMessage(Throwable excp) {
 		List<String> errList = new ArrayList<String>();
 		while (excp != null) {
-			if (!errList.contains(excp.getMessage() + "\n")) {
-				errList.add(excp.getMessage() + "\n");
+			if (!errList.contains(excp.getMessage() + ". \n")) {
+				errList.add(excp.getMessage() + ". \n");
 			}
 			excp = excp.getCause();
 		}
-		return StringUtils.join(errList, ". ");
+		return StringUtils.join(errList, "");
 	}
 	
 }

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/lookup-client/src/main/java/com/xasecure/hbase/client/HBaseClient.java
----------------------------------------------------------------------
diff --git a/lookup-client/src/main/java/com/xasecure/hbase/client/HBaseClient.java b/lookup-client/src/main/java/com/xasecure/hbase/client/HBaseClient.java
index 292e53c..5ae4e80 100644
--- a/lookup-client/src/main/java/com/xasecure/hbase/client/HBaseClient.java
+++ b/lookup-client/src/main/java/com/xasecure/hbase/client/HBaseClient.java
@@ -98,7 +98,7 @@ public class HBaseClient extends BaseClient {
 			generateResponseDataMap(connectivityStatus, successMsg, successMsg,
 					null, null, responseData);
 		} else {
-			String failureMsg = "Unable to retrive any databases using given parameters.";
+			String failureMsg = "Unable to retrieve any databases using given parameters.";
 			generateResponseDataMap(connectivityStatus, failureMsg, failureMsg
 					+ errMsg, null, null, responseData);
 		}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/lookup-client/src/main/java/com/xasecure/hive/client/HiveClient.java
----------------------------------------------------------------------
diff --git a/lookup-client/src/main/java/com/xasecure/hive/client/HiveClient.java b/lookup-client/src/main/java/com/xasecure/hive/client/HiveClient.java
index bfbf0f9..09abecf 100644
--- a/lookup-client/src/main/java/com/xasecure/hive/client/HiveClient.java
+++ b/lookup-client/src/main/java/com/xasecure/hive/client/HiveClient.java
@@ -457,7 +457,7 @@ public class HiveClient extends BaseClient implements Closeable {
 			generateResponseDataMap(connectivityStatus, successMsg, successMsg,
 					null, null, responseData);
 		} else {
-			String failureMsg = "Unable to retrive any databases using given parameters.";
+			String failureMsg = "Unable to retrieve any databases using given parameters.";
 			generateResponseDataMap(connectivityStatus, failureMsg, failureMsg + errMsg,
 					null, null, responseData);
 		}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/lookup-client/src/main/java/com/xasecure/knox/client/KnoxClient.java
----------------------------------------------------------------------
diff --git a/lookup-client/src/main/java/com/xasecure/knox/client/KnoxClient.java b/lookup-client/src/main/java/com/xasecure/knox/client/KnoxClient.java
index d4aa734..e9825de 100644
--- a/lookup-client/src/main/java/com/xasecure/knox/client/KnoxClient.java
+++ b/lookup-client/src/main/java/com/xasecure/knox/client/KnoxClient.java
@@ -113,8 +113,6 @@ public class KnoxClient {
 					}
 
 				} else {
-					// LOG.error("Unable to get a valid response for isFileChanged()  call for ["
-					// + knoxUrl + "] - got null response.");
 					String msgDesc = "Unable to get a valid response for "
 							+ "isFileChanged() call for KnoxUrl : [" + knoxUrl
 							+ "] - got null response.";
@@ -133,18 +131,15 @@ public class KnoxClient {
 					client.destroy();
 				}
 			}
+		} catch (HadoopException he) {
+			throw he;
 		} catch (Throwable t) {
-			// LOG.error("Exception on REST call to: " + knoxUrl, t);
-			// t.printStackTrace();
-
 			String msgDesc = "Exception on REST call to KnoxUrl : " + knoxUrl + ".";
 			HadoopException hdpException = new HadoopException(msgDesc, t);
 			LOG.error(msgDesc, t);
 
-			if (!(t instanceof HadoopException)) {
-				hdpException.generateResponseDataMap(false,
-						BaseClient.getMessage(t), msgDesc + errMsg, null, null);
-			}
+			hdpException.generateResponseDataMap(false,
+					BaseClient.getMessage(t), msgDesc + errMsg, null, null);
 			throw hdpException;
 		} finally {
 		}
@@ -203,8 +198,6 @@ public class KnoxClient {
 					}
 
 				} else {
-					// LOG.error("Unable to get a valid response for isFileChanged()  call for ["
-					// + knoxUrl + "] - got null response.");
 					String msgDesc = "Unable to get a valid response for "
 							+ "isFileChanged() call for KnoxUrl : [" + knoxUrl
 							+ "] - got null response.";
@@ -223,18 +216,15 @@ public class KnoxClient {
 					client.destroy();
 				}
 			}
+		} catch (HadoopException he) {
+			throw he;
 		} catch (Throwable t) {
-			// LOG.error("Exception on REST call to: " + knoxUrl, t);
-			// t.printStackTrace();
-
 			String msgDesc = "Exception on REST call to KnoxUrl : " + knoxUrl + ".";
 			HadoopException hdpException = new HadoopException(msgDesc, t);
 			LOG.error(msgDesc, t);
 
-			if (!(t instanceof HadoopException)) {
-				hdpException.generateResponseDataMap(false,
-						BaseClient.getMessage(t), msgDesc + errMsg, null, null);
-			}
+			hdpException.generateResponseDataMap(false,
+					BaseClient.getMessage(t), msgDesc + errMsg, null, null);
 			throw hdpException;
 
 		} finally {
@@ -242,8 +232,6 @@ public class KnoxClient {
 		return serviceList;
 	}
 
-	
-
 	public static void main(String[] args) {
 
 		KnoxClient knoxClient = null;
@@ -298,7 +286,7 @@ public class KnoxClient {
 			BaseClient.generateResponseDataMap(connectivityStatus, successMsg, successMsg,
 					null, null, responseData);
 		} else {
-			String failureMsg = "Unable to retrive any topologies/services using given parameters.";
+			String failureMsg = "Unable to retrieve any topologies/services using given parameters.";
 			BaseClient.generateResponseDataMap(connectivityStatus, failureMsg, failureMsg + errMsg,
 					null, null, responseData);
 		}
@@ -376,16 +364,15 @@ public class KnoxClient {
 			}
 			resultList = timedTask(callableObj, 5, TimeUnit.SECONDS);
 
+		} catch (HadoopException he) {
+			throw he;
 		} catch (Exception e) {
 			String msgDesc = "Unable to get knox resources.";
 			LOG.error(msgDesc, e);
 			HadoopException hdpException = new HadoopException(msgDesc);
 
-			if (!(e instanceof HadoopException)) {
-				hdpException.generateResponseDataMap(false,
-						BaseClient.getMessage(e), msgDesc + errMsg, null, null);
-			}
-
+			hdpException.generateResponseDataMap(false,
+					BaseClient.getMessage(e), msgDesc + errMsg, null, null);
 			throw hdpException;
 		}
 

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/lookup-client/src/main/java/com/xasecure/storm/client/StormClient.java
----------------------------------------------------------------------
diff --git a/lookup-client/src/main/java/com/xasecure/storm/client/StormClient.java b/lookup-client/src/main/java/com/xasecure/storm/client/StormClient.java
index 2d40973..95e49a9 100644
--- a/lookup-client/src/main/java/com/xasecure/storm/client/StormClient.java
+++ b/lookup-client/src/main/java/com/xasecure/storm/client/StormClient.java
@@ -314,7 +314,7 @@ public class StormClient {
 			BaseClient.generateResponseDataMap(connectivityStatus, successMsg,
 					successMsg, null, null, responseData);
 		} else {
-			String failureMsg = "Unable to retrive any topologies using given parameters.";
+			String failureMsg = "Unable to retrieve any topologies using given parameters.";
 			BaseClient.generateResponseDataMap(connectivityStatus, failureMsg,
 					failureMsg + errMsg, null, null, responseData);
 		}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java b/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
index 125dd0a..aa02e07 100644
--- a/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
+++ b/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
@@ -1675,6 +1675,9 @@ public class AssetMgr extends AssetMgrBase {
 				message = (respData != null && respData.get("message") != null) ? respData.get(
 						"message").toString() : msg;
 			}
+			if(respData == null) {
+				respData = new HashMap<String, Object>();
+			}
 			testResponse = generateResponseForTestConn(respData, message);
 			logger.error(msg, e);
 		}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js b/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
index 9df4138..b63faa1 100644
--- a/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
@@ -229,7 +229,9 @@ define(function(require){
 							if(!_.isUndefined(msResponse) && _.isArray(msResponse.messageList) 
 														  && !_.isUndefined(msResponse.messageList[0].message)){
 								if(!_.isEmpty(msResponse.messageList[0].message) && msResponse.messageList[0].message
!= "\n"){
-									bootbox.dialog('<b>'+msResponse.messageList[0].message+'</b>',	[{
+									var msg = '<div class="connection-error-font">'+msResponse.messageList[0].message.split('\n').join('<br>')+'</div>'
+									var msgHtml = '<b>Connection Failed.</b></br>'+msg;
+									bootbox.dialog(msgHtml,	[{
 										label: "Show More..",
 										callback:function(e){
 											console.log(e)

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/fa1aaa5b/security-admin/src/main/webapp/styles/xa.css
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/styles/xa.css b/security-admin/src/main/webapp/styles/xa.css
index 290cb76..6bd5d3a 100644
--- a/security-admin/src/main/webapp/styles/xa.css
+++ b/security-admin/src/main/webapp/styles/xa.css
@@ -1652,4 +1652,8 @@ td.html-cell.renderable:last-child {
 }
 .policy-manager table thead tr th:first-child a {
 	color: #707070;
+}
+.connection-error-font {
+	font-size: 11px;
+	font-family: monospace;
 }
\ No newline at end of file


Mime
View raw message