You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by am...@apache.org on 2023/07/17 13:54:30 UTC
[knox] branch master updated: KNOX-2936 - knoxcli convert-topology doesn't work with output-path parameter (#770)
This is an automated email from the ASF dual-hosted git repository.
amagyar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git
The following commit(s) were added to refs/heads/master by this push:
new 82a31c5ca KNOX-2936 - knoxcli convert-topology doesn't work with output-path parameter (#770)
82a31c5ca is described below
commit 82a31c5cab3b8078162a6d0c1d76ae22be4a1d5d
Author: Attila Magyar <m....@gmail.com>
AuthorDate: Mon Jul 17 15:54:25 2023 +0200
KNOX-2936 - knoxcli convert-topology doesn't work with output-path parameter (#770)
---
.../src/main/java/org/apache/knox/gateway/util/KnoxCLI.java | 2 +-
.../main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java b/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java
index f343e2ecf..bdeb8ad22 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java
@@ -2303,7 +2303,7 @@ public class KnoxCLI extends Configured implements Tool {
+ "--descriptor-name (optional) name of descriptor json config file (including .json extension) \n"
+ "--topology-name (optional) topology-name can be use instead of --path option, if used, KnoxCLI will attempt to find topology from deployed topologies.\n"
+ "\t if not provided topology name will be used as descriptor name \n"
- + "--output-path (optional) output directory to save provider and descriptor config files \n"
+ + "--output-dir (optional) output directory to save provider and descriptor config files \n"
+ "\t if not provided config files will be saved in appropriate Knox config directory \n"
+ "--force (optional) force rewriting of existing files, if not used, command will fail when the configs files with same name already exist. \n"
+ "--cluster (optional) cluster name, required for service discovery \n"
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java b/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java
index 316690138..0d3c67f9a 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java
@@ -227,7 +227,9 @@ public class TopologyToDescriptor {
file.getAbsolutePath()));
}
/* make sure file and directories are in place */
- Files.createDirectories(file.toPath().getParent());
+ if (!file.getParentFile().exists()) {
+ Files.createDirectories(file.toPath().getParent());
+ }
file.createNewFile();
}