sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2226: Sqoop2: Access denied in shell
Date Thu, 26 Mar 2015 01:23:35 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 be74759e7 -> 06f6ceceb


SQOOP-2226: Sqoop2: Access denied in shell

(Richard Zhou via Abraham Elmahrek)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/06f6cece
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/06f6cece
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/06f6cece

Branch: refs/heads/sqoop2
Commit: 06f6ceceb9ae64208359a5ff59a876f6a211fe53
Parents: be74759
Author: Abraham Elmahrek <abe@apache.org>
Authored: Wed Mar 25 18:23:10 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Wed Mar 25 18:23:10 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/sqoop/shell/ShowLinkFunction.java    | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/06f6cece/shell/src/main/java/org/apache/sqoop/shell/ShowLinkFunction.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/sqoop/shell/ShowLinkFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowLinkFunction.java
index 1a5f354..f93bc5d 100644
--- a/shell/src/main/java/org/apache/sqoop/shell/ShowLinkFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowLinkFunction.java
@@ -19,6 +19,7 @@ package org.apache.sqoop.shell;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.model.MConnector;
 import org.apache.sqoop.model.MLink;
 import org.apache.sqoop.shell.core.Constants;
@@ -140,9 +141,13 @@ public class ShowLinkFunction extends SqoopFunction {
     Map<String, String> connectorIdToName = new HashMap<String, String>();
     for (String connectorId : connectorIds) {
       if (!connectorIdToName.containsKey(connectorId)) {
-        MConnector connector = client.getConnector(Long.valueOf(connectorId));
-        if (connector != null) {
-          connectorIdToName.put(connectorId, connector.getUniqueName());
+        try {
+          MConnector connector = client.getConnector(Long.valueOf(connectorId));
+          if (connector != null) {
+            connectorIdToName.put(connectorId, connector.getUniqueName());
+          }
+        } catch (SqoopException ex) {
+          connectorIdToName.put(connectorId, "Access Denied");
         }
       }
     }


Mime
View raw message