You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dd...@apache.org on 2011/12/15 00:58:09 UTC
svn commit: r1214562 - in /incubator/ambari/trunk:
agent/src/main/python/ambari_agent/ActionQueue.py
agent/src/test/python/TestAgentActions.py
controller/src/main/java/org/apache/ambari/controller/Controller.java
Author: ddas
Date: Wed Dec 14 23:58:08 2011
New Revision: 1214562
URL: http://svn.apache.org/viewvc?rev=1214562&view=rev
Log:
AMBARI-159. Commented out some more security stuff.
Modified:
incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py
incubator/ambari/trunk/agent/src/test/python/TestAgentActions.py
incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Controller.java
Modified: incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py?rev=1214562&r1=1214561&r2=1214562&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py (original)
+++ incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py Wed Dec 14 23:58:08 2011
@@ -158,6 +158,7 @@ class ActionQueue(threading.Thread):
# Install and configure action
def installAndConfigAction(self, action):
global installScriptHash
+ r=self.genResult(action)
w = self.writeFileAction(action,self.getInstallFilename(action['id']))
commandResult = {}
if w['exitCode']!=0:
@@ -184,14 +185,11 @@ class ActionQueue(threading.Thread):
logger.debug(arr)
action['command'] = arr
logger.debug(action['command'])
- r = self.sh.run(action['command'])
- logger.debug("PUPPET COMMAND OUTPUT: " + r['output'])
- logger.debug("PUPPET COMMAND ERROR: " + r['error'])
- if r['exitCode'] != 0:
- commandResult['error'] = r['error']
- else:
+ commandResult = self.sh.run(action['command'])
+ logger.debug("PUPPET COMMAND OUTPUT: " + commandResult['output'])
+ logger.debug("PUPPET COMMAND ERROR: " + commandResult['error'])
+ if commandResult['exitCode'] == 0:
installScriptHash = action['id']
- commandResult['exitCode'] = r['exitCode']
r['commandResult'] = commandResult
return r
@@ -219,7 +217,7 @@ class ActionQueue(threading.Thread):
return deleteStructure(action, result)
def noOpAction(self, action):
- r = {'exitCode' : 0 }
+ r = {'id' : action['id']}
return r
# Handle unknown action
Modified: incubator/ambari/trunk/agent/src/test/python/TestAgentActions.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/test/python/TestAgentActions.py?rev=1214562&r1=1214561&r2=1214562&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/test/python/TestAgentActions.py (original)
+++ incubator/ambari/trunk/agent/src/test/python/TestAgentActions.py Wed Dec 14 23:58:08 2011
@@ -54,5 +54,6 @@ class TestAgentActions(TestCase):
result = { }
actionQueue = ActionQueue(AmbariConfig().getConfig())
result = actionQueue.installAndConfigAction(action)
- self.assertEqual(result['exitCode'], 0, "installAndConfigAction test failed. Returned %d " % result['exitCode'])
- self.assertEqual(result['output'], path + "\n", "installAndConfigAction test failed Returned %s " % result['output'])
+ cmdResult = result['commandResult']
+ self.assertEqual(cmdResult['exitCode'], 0, "installAndConfigAction test failed. Returned %d " % cmdResult['exitCode'])
+ self.assertEqual(cmdResult['output'], path + "\n", "installAndConfigAction test failed Returned %s " % cmdResult['output'])
Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Controller.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Controller.java?rev=1214562&r1=1214561&r2=1214562&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Controller.java (original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Controller.java Wed Dec 14 23:58:08 2011
@@ -81,7 +81,7 @@ public class Controller {
"org.apache.ambari.controller.rest.config.PrivateWadlGeneratorConfig");
root.addServlet(agent, "/agent/*");
agent.setInitOrder(3);
-
+/* //COMMENTED THE FOLLOWING LINE TO WORK AROUND AMBARI-159
Constraint constraint = new Constraint();
constraint.setName(Constraint.__BASIC_AUTH);;
constraint.setRoles(new String[]{"user","admin","moderator"});
@@ -96,8 +96,8 @@ public class Controller {
System.getenv("AMBARI_CONF_DIR")+"/auth.conf"));
security.setConstraintMappings(new ConstraintMapping[]{cm});
- //COMMENTED THE FOLLOWING LINE TO WORK AROUND AMBARI-159
- //root.addHandler(security);
+ //root.addHandler(security);
+*/
server.setStopAtShutdown(true);
/*