ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-87: modified to support install of storm config/lib files
Date Fri, 03 Oct 2014 02:21:58 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master b83ae91f3 -> 01fb970fe


ARGUS-87: modified to support install of storm config/lib files


Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/01fb970f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/01fb970f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/01fb970f

Branch: refs/heads/master
Commit: 01fb970fe1494735ed2aeffa881b6d59d20150f7
Parents: b83ae91
Author: sneethiraj <sneethir@apache.org>
Authored: Thu Oct 2 19:17:42 2014 -0700
Committer: sneethiraj <sneethir@apache.org>
Committed: Thu Oct 2 19:17:42 2014 -0700

----------------------------------------------------------------------
 agents-common/scripts/enable-agent.sh | 64 ++++++++++++++++++++++++++++++
 src/main/assembly/storm-agent.xml     |  2 +
 2 files changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/01fb970f/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index f92c692..b6884de 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -475,6 +475,70 @@ then
 	done
 fi
 
+if [ "${HCOMPONENT_NAME}" = "storm" ]
+then
+	CFG_FILE=${HCOMPONENT_CONF_DIR}/storm.yaml
+	ARCHIVE_FILE=${HCOMPONENT_CONF_DIR}/.storm.yaml.`date '+%Y%m%d%H%M%S'`
+
+	if [ -f "${CFG_FILE}" ]
+	then
+		cp ${CFG_FILE}  ${ARCHIVE_FILE}
+
+    	if [ "${action}" = "enable" ]
+    	then
+			awk -F: 'BEGIN {
+    			configured = 0 ;
+			}
+			{
+    			if ($1 == "nimbus.authorizer") {
+        			if ($2 ~ /^[ \t]*"com.xasecure.authorization.storm.authorizer.XaSecureStormAuthorizer"[
\t]*$/) {
+            			configured = 1 ;
+            			printf("%s\n",$0) ;
+        			}
+        			else {
+            			printf("#%s\n",$0);
+            			printf("nimbus.authorizer: \"com.xasecure.authorization.storm.authorizer.XaSecureStormAuthorizer\"\n")
;
+            			configured = 1 ;
+        			}
+    			}
+    			else {
+        			printf("%s\n",$0) ;
+    			}
+			}
+			END {
+    			if (configured == 0) {
+        			printf("nimbus.authorizer: \"com.xasecure.authorization.storm.authorizer.XaSecureStormAuthorizer\"\n")
;
+    			}
+			}' ${CFG_FILE} > ${CFG_FILE}.new &&  cat ${CFG_FILE}.new > ${CFG_FILE} &&
rm -f ${CFG_FILE}.new
+
+		else
+			awk -F: 'BEGIN {
+                configured = 0 ;
+            }
+            {
+                if ($1 == "nimbus.authorizer") {
+                    if ($2 ~ /^[ \t]*"backtype.storm.security.auth.authorizer.SimpleACLAuthorizer"[
\t]*$/) {
+                        configured = 1 ;
+                        printf("%s\n",$0) ;
+                    }
+                    else {
+                        printf("#%s\n",$0);
+                        printf("nimbus.authorizer: \"backtype.storm.security.auth.authorizer.SimpleACLAuthorizer\"\n")
;
+                        configured = 1 ;
+                    }
+                }
+                else {
+                    printf("%s\n",$0) ;
+                }
+            }
+            END {
+                if (configured == 0) {
+                    printf("nimbus.authorizer: \"backtype.storm.security.auth.authorizer.SimpleACLAuthorizer\"\n")
;
+                }
+            }' ${CFG_FILE} > ${CFG_FILE}.new &&  cat ${CFG_FILE}.new > ${CFG_FILE}
&& rm -f ${CFG_FILE}.new	
+		fi
+	fi
+fi
 
 #
 # Set notice to restart the ${HCOMPONENT_NAME}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/01fb970f/src/main/assembly/storm-agent.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/storm-agent.xml b/src/main/assembly/storm-agent.xml
index ff61a04..cd1d7d9 100644
--- a/src/main/assembly/storm-agent.xml
+++ b/src/main/assembly/storm-agent.xml
@@ -26,6 +26,8 @@
                     <include>org.eclipse.persistence:javax.persistence</include>
                     <include>commons-collections:commons-collections</include>
 					<include>com.sun.jersey:jersey-bundle</include>
+                    <include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
+                    <include>com.google.guava:guava:jar:${guava.version}</include>
                 </includes>
             </dependencySet>
             <dependencySet>


Mime
View raw message