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 01:00:28 UTC

svn commit: r1214567 - 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: Thu Dec 15 00:00:28 2011
New Revision: 1214567

URL: http://svn.apache.org/viewvc?rev=1214567&view=rev
Log:
AMBARI-159. Reverted the last commit since I had checked in some files unintentially.

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=1214567&r1=1214566&r2=1214567&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 Thu Dec 15 00:00:28 2011
@@ -158,7 +158,6 @@ 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:
@@ -185,11 +184,14 @@ class ActionQueue(threading.Thread):
       logger.debug(arr)
       action['command'] = arr
     logger.debug(action['command'])
-    commandResult = self.sh.run(action['command'])
-    logger.debug("PUPPET COMMAND OUTPUT: " + commandResult['output'])
-    logger.debug("PUPPET COMMAND ERROR: " + commandResult['error'])
-    if commandResult['exitCode'] == 0:
+    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:
       installScriptHash = action['id'] 
+    commandResult['exitCode'] = r['exitCode']
     r['commandResult'] = commandResult
     return r
 
@@ -217,7 +219,7 @@ class ActionQueue(threading.Thread):
     return deleteStructure(action, result)
 
   def noOpAction(self, action):
-    r = {'id' : action['id']}
+    r = {'exitCode' : 0 }
     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=1214567&r1=1214566&r2=1214567&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/test/python/TestAgentActions.py (original)
+++ incubator/ambari/trunk/agent/src/test/python/TestAgentActions.py Thu Dec 15 00:00:28 2011
@@ -54,6 +54,5 @@ class TestAgentActions(TestCase):
     result = { }
     actionQueue = ActionQueue(AmbariConfig().getConfig())
     result = actionQueue.installAndConfigAction(action)
-    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'])
+    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'])

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=1214567&r1=1214566&r2=1214567&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 Thu Dec 15 00:00:28 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});
 
-      //root.addHandler(security);  
-*/
+      //COMMENTED THE FOLLOWING LINE TO WORK AROUND AMBARI-159
+      //root.addHandler(security);
       server.setStopAtShutdown(true);
       
       /*