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-291: Improve audit for topology deployment process
Date Mon, 20 Apr 2015 20:35:13 GMT
Repository: knox
Updated Branches:
  refs/heads/master d495eb3da -> d9f8cf41e


KNOX-291: Improve audit for topology deployment process


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

Branch: refs/heads/master
Commit: d9f8cf41e05be1c68766a22402bb03d55feb547c
Parents: d495eb3
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Mon Apr 20 16:34:30 2015 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Mon Apr 20 16:34:30 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/knox/blob/d9f8cf41/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 34aeee7..88d90f0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,7 @@ Release Notes - Apache Knox - Version 0.6.0
 ** Improvement
   * [KNOX-462] - Proper error message when root tag of topology file incorrect
   * [KNOX-501] - Avoid NPE in case of passing invalid argument to KnoxCli.
+  * [KNOX-291] - Improve audit for topology deployment process
 
 ** Bug
   * [KNOX-378] - Knox rewrites numbers in JSON to engineering notation

http://git-wip-us.apache.org/repos/asf/knox/blob/d9f8cf41/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 c0f2a68..0072e7e 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
@@ -364,6 +364,8 @@ public class GatewayServer {
     try {
       context.start();
     } catch( Exception e ) {
+      auditor
+          .audit(Action.DEPLOY, topology.getName(), ResourceType.TOPOLOGY, ActionOutcome.FAILURE);
       log.failedToDeployTopology( name, e );
     }
   }
@@ -379,6 +381,8 @@ public class GatewayServer {
       try {
         context.stop();
       } catch( Exception e ) {
+        auditor.audit(Action.UNDEPLOY, topology.getName(), ResourceType.TOPOLOGY,
+          ActionOutcome.FAILURE);
         log.failedToUndeployTopology( topology.getName(), e );
       }
     }
@@ -405,8 +409,9 @@ public class GatewayServer {
     private void handleDeleteDeployment(Topology topology, File deployDir) {
       File[] files = deployDir.listFiles( new WarDirFilter( topology.getName() + "\\.war\\.[0-9A-Fa-f]+"
) );
       if( files != null ) {
+        auditor.audit(Action.UNDEPLOY, topology.getName(), ResourceType.TOPOLOGY,
+          ActionOutcome.UNAVAILABLE);
         for( File file : files ) {
-          auditor.audit( Action.UNDEPLOY, topology.getName(), ResourceType.TOPOLOGY, ActionOutcome.UNAVAILABLE
);
           log.deletingDeployment( file.getAbsolutePath() );
           internalUndeploy( topology );
           FileUtils.deleteQuietly( file );


Mime
View raw message