knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject knox git commit: KNOX-564: NPE for Topology with no Providers Confgured
Date Fri, 24 Jul 2015 15:51:44 GMT
Repository: knox
Updated Branches:
  refs/heads/master db926c9e7 -> 611ffae8d


KNOX-564: NPE for Topology with no Providers Confgured


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/611ffae8
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/611ffae8
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/611ffae8

Branch: refs/heads/master
Commit: 611ffae8d1bec04bffc93605f7acc8f1e8c7f728
Parents: db926c9
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Fri Jul 24 11:51:37 2015 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Fri Jul 24 11:51:37 2015 -0400

----------------------------------------------------------------------
 CHANGES                                                       | 1 +
 .../main/java/org/apache/hadoop/gateway/GatewayServer.java    | 7 +++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/611ffae8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index affc2f8..af20c8a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,7 @@ Release Notes - Apache Knox - Version 0.7.0
     * [KNOX-553] - Added topology validation from KnoxCLI to TopologyService deployment.
     * [KNOX-561] - Allow Knox pid directory to be configured via the knox-env.sh file
     * [KNOX-575] - Adds more logging for ShiroProvider LDAP Authentication.
+    * [KNOX-564] - Topology deployment fails for no configured providers
 
 ** Bug
     * [KNOX-554] - Fixed support for gateway.path change + added support for X-Forward-*
headers in admin topology API.

http://git-wip-us.apache.org/repos/asf/knox/blob/611ffae8/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
index 5520d60..b6e44c3 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
@@ -59,6 +59,7 @@ import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.security.ProviderException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -435,6 +436,12 @@ public class GatewayServer {
         File warDir = calculateDeploymentDir( topology );
         if( !warDir.exists() ) {
           auditor.audit( Action.DEPLOY, topology.getName(), ResourceType.TOPOLOGY, ActionOutcome.UNAVAILABLE
);
+
+//          KNOX-564 - Topology should fail to deploy with no providers configured.
+          if(topology.getProviders().isEmpty()) {
+            throw new ProviderException("No providers found inside topology.");
+          }
+
           log.deployingTopology( topology.getName(), warDir.getAbsolutePath() );
           internalUndeploy( topology ); // KNOX-152
           WebArchive war = null;


Mime
View raw message