Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 414a8e1a4 -> d8e047580


AMBARI-15795. Parallel execution should only be allowed on commands that have 
auto retry enabled - test fixes (smohanty)


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

Branch: refs/heads/branch-2.2
Commit: d8e0475808d6ab19ebcf032e582c7ef11a8b7593
Parents: 414a8e1
Author: Sumit Mohanty <[email protected]>
Authored: Wed Apr 13 07:40:09 2016 -0700
Committer: Sumit Mohanty <[email protected]>
Committed: Wed Apr 13 07:57:46 2016 -0700

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/ActionQueue.py     | 2 +-
 ambari-agent/src/test/python/ambari_agent/TestActionQueue.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d8e04758/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py 
b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 619e938..c4d0b5e 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -160,7 +160,7 @@ class ActionQueue(threading.Thread):
             # checking just one command is enough as all commands for a stage 
is sent
             # at the same time and retry is only enabled for initial 
start/install
             retryAble = False
-            if 'command_retry_enabled' in command['commandParams']:
+            if 'commandParams' in command and 'command_retry_enabled' in 
command['commandParams']:
               retryAble = command['commandParams']['command_retry_enabled'] == 
"true"
             if retryAble:
               logger.info("Kicking off a thread for the command, id=" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d8e04758/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py 
b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
index cb0574f..a81bc55 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -928,7 +928,7 @@ class TestActionQueue(TestCase):
     actionQueue.stop()
     actionQueue.join()
     self.assertEqual(actionQueue.stopped(), True, 'Action queue is not 
stopped.')
-    self.assertEqual(1, process_command_mock.call_count)
+    self.assertEqual(2, process_command_mock.call_count)
     self.assertEqual(0, threading_mock.call_count)
     
process_command_mock.assert_any_calls([call(self.datanode_install_command), 
call(self.hbase_install_command)])
 

Reply via email to