knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject knox git commit: KNOX-1253 - TopologyService incorrectly reports failure to delete file that has been successfully deleted.
Date Fri, 20 Apr 2018 13:52:51 GMT
Repository: knox
Updated Branches:
  refs/heads/master 2caee34ee -> e587af9fb


KNOX-1253 - TopologyService incorrectly reports failure to delete file that has been successfully
deleted.


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

Branch: refs/heads/master
Commit: e587af9fb6a0cbecce9d0d89f28aa227388c3502
Parents: 2caee34
Author: Phil Zampino <pzampino@apache.org>
Authored: Fri Apr 20 09:35:46 2018 -0400
Committer: Phil Zampino <pzampino@apache.org>
Committed: Fri Apr 20 09:35:46 2018 -0400

----------------------------------------------------------------------
 .../services/topology/impl/DefaultTopologyService.java        | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/e587af9f/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
b/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
index 5a01651..4a9713a 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
@@ -468,10 +468,9 @@ public class DefaultTopologyService
       // registry, even if it does not exist locally.
       deleteRemoteEntry("/knox/config/shared-providers", name);
 
-      if (providerConfig != null) {
-        // Whether the remote configuration registry is being employed or not, delete the
local file if it exists
-        result = providerConfig.delete();
-      }
+      // Whether the remote configuration registry is being employed or not, delete the local
file if it exists
+      result = providerConfig == null || !providerConfig.exists() || providerConfig.delete();
+
     } else {
       log.preventedDeletionOfSharedProviderConfiguration(providerConfig.getAbsolutePath());
     }


Mime
View raw message