knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject knox git commit: KNOX-866 - Fix validate-topology cli command (Richard Ding via Sandeep More)
Date Tue, 14 Feb 2017 20:00:13 GMT
Repository: knox
Updated Branches:
  refs/heads/master 7cb85e28b -> 2bec31857


KNOX-866 - Fix validate-topology cli command (Richard Ding via Sandeep More)


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

Branch: refs/heads/master
Commit: 2bec3185795a268b4ac447a5e22582be6f120fc8
Parents: 7cb85e2
Author: Sandeep More <more@apache.org>
Authored: Tue Feb 14 14:58:49 2017 -0500
Committer: Sandeep More <more@apache.org>
Committed: Tue Feb 14 14:59:49 2017 -0500

----------------------------------------------------------------------
 .../hadoop/gateway/topology/validation/TopologyValidator.java     | 2 +-
 .../src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java     | 3 +--
 .../src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/2bec3185/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/validation/TopologyValidator.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/validation/TopologyValidator.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/validation/TopologyValidator.java
index a29758c..548f013 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/validation/TopologyValidator.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/validation/TopologyValidator.java
@@ -57,7 +57,7 @@ public class TopologyValidator {
     try {
       SchemaFactory fact = SchemaFactory
           .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-      URL schemaUrl = ClassLoader.getSystemResource( "conf/topology-v1.xsd" );
+      URL schemaUrl = getClass().getResource( "/conf/topology-v1.xsd" );
       Schema s = fact.newSchema( schemaUrl );
       Validator validator = s.newValidator();
       final List<SAXParseException> exceptions = new LinkedList<>();

http://git-wip-us.apache.org/repos/asf/knox/blob/2bec3185/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
index b3baae4..6f8565d 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
@@ -98,7 +98,6 @@ public class KnoxCLI extends Configured implements Tool {
       "   [" + AliasDeleteCommand.USAGE + "]\n" +
       "   [" + AliasListCommand.USAGE + "]\n" +
       "   [" + RedeployCommand.USAGE + "]\n" +
-      "   [" + RedeployCommand.USAGE + "]\n" +
       "   [" + ListTopologiesCommand.USAGE + "]\n" +
       "   [" + ValidateTopologyCommand.USAGE + "]\n" +
       "   [" + LDAPAuthCommand.USAGE + "]\n" +
@@ -142,7 +141,7 @@ public class KnoxCLI extends Configured implements Tool {
       if (command != null && command.validate()) {
         initializeServices( command instanceof MasterCreateCommand );
         command.execute();
-      } else {
+      } else if (!(command instanceof MasterCreateCommand)){
         out.println("ERROR: Invalid Command" + "\n" + "Unrecognized option:" +
             args[0] + "\n" +
             "A fatal exception has occurred. Program will exit.");

http://git-wip-us.apache.org/repos/asf/knox/blob/2bec3185/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
b/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
index 8eed6ab..0352fa3 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
@@ -444,7 +444,7 @@ public class KnoxCLITest {
 
     outContent.reset();
     rc = cli.run(args);
-    assertThat( rc, not(is(0)) );
+    assertThat( rc, is(0 ) );
     assertThat( outContent.toString(), containsString( "Master secret is already present
on disk." ) );
 
     outContent.reset();


Mime
View raw message