knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject [2/2] knox git commit: KNOX-1271 - AtlasZookeeperURLManager not handling empty namespace config values correctly
Date Tue, 24 Apr 2018 13:49:43 GMT
KNOX-1271 - AtlasZookeeperURLManager not handling empty namespace config values correctly


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

Branch: refs/heads/master
Commit: 31e8dc07f86f5c68f82f868c6dded3919b5a516c
Parents: dab6c82
Author: Phil Zampino <pzampino@apache.org>
Authored: Tue Apr 24 09:16:57 2018 -0400
Committer: Phil Zampino <pzampino@apache.org>
Committed: Tue Apr 24 09:16:57 2018 -0400

----------------------------------------------------------------------
 .../knox/gateway/ha/provider/impl/AtlasZookeeperURLManager.java | 2 +-
 .../gateway/ha/provider/impl/AtlasZookeeperURLManagerTest.java  | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/31e8dc07/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManager.java
----------------------------------------------------------------------
diff --git a/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManager.java
b/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManager.java
index 2f489a1..2412ed2 100644
--- a/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManager.java
+++ b/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManager.java
@@ -53,7 +53,7 @@ public class AtlasZookeeperURLManager extends DefaultURLManager {
     public void setConfig(HaServiceConfig config) {
         zooKeeperEnsemble = config.getZookeeperEnsemble();
         zooKeeperNamespace = config.getZookeeperNamespace();
-        if (zooKeeperNamespace != null) {
+        if (zooKeeperNamespace != null && !zooKeeperNamespace.isEmpty()) {
             if (!zooKeeperNamespace.startsWith("/")) {
                 zooKeeperNamespace = "/" + zooKeeperNamespace;
             }

http://git-wip-us.apache.org/repos/asf/knox/blob/31e8dc07/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManagerTest.java
----------------------------------------------------------------------
diff --git a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManagerTest.java
b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManagerTest.java
index 6f6c6ce..7b99c6a 100644
--- a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManagerTest.java
+++ b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/AtlasZookeeperURLManagerTest.java
@@ -121,6 +121,11 @@ public class AtlasZookeeperURLManagerTest {
         doTestAtlasZooKeeperURLManager("ATLAS-API", true, cluster.getConnectString(), "/apache_atlas");
     }
 
+    @Test
+    public void testAtlasAPIURLManagerWithEmptyNamespace() {
+        doTestAtlasZooKeeperURLManager("ATLAS-API", true, cluster.getConnectString(), "");
+    }
+
     private void doTestAtlasZooKeeperURLManager(final String  serviceName,
                                                 final boolean enabled,
                                                 final String  ensemble,


Mime
View raw message