You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2015/03/17 14:43:29 UTC

ambari git commit: AMBARI-10083 - Ambari Agent Alerts Prevents Binding to the Ping Port Listener On Startup (part 2) (jonathanhurley)

Repository: ambari
Updated Branches:
  refs/heads/trunk 8a821dbf2 -> 966d39333


AMBARI-10083 - Ambari Agent Alerts Prevents Binding to the Ping Port Listener On Startup (part 2) (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 966d39333e60b9b0c2a0b01954f067471e87c152
Parents: 8a821db
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Mar 17 09:43:01 2015 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Tue Mar 17 09:43:01 2015 -0400

----------------------------------------------------------------------
 ambari-agent/src/test/python/ambari_agent/TestController.py  | 8 ++++----
 .../src/test/python/ambari_agent/TestProcessHelper.py        | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/966d3933/ambari-agent/src/test/python/ambari_agent/TestController.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestController.py b/ambari-agent/src/test/python/ambari_agent/TestController.py
index 92ce46f..e2fd7a7 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestController.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestController.py
@@ -339,12 +339,12 @@ class TestController(unittest.TestCase):
     self.assertTrue(sendRequestMock.call_count > 5)
 
 
-  @patch("os._exit")
-  def test_restartAgent(self, os_exit_mock):
+  @patch("sys.exit")
+  def test_restartAgent(self, sys_exit_mock):
 
     self.controller.restartAgent()
-    self.assertTrue(os_exit_mock.called)
-    self.assertTrue(os_exit_mock.call_args[0][0] == AGENT_AUTO_RESTART_EXIT_CODE)
+    self.assertTrue(sys_exit_mock.called)
+    self.assertTrue(sys_exit_mock.call_args[0][0] == AGENT_AUTO_RESTART_EXIT_CODE)
 
 
   @patch("urllib2.Request")

http://git-wip-us.apache.org/repos/asf/ambari/blob/966d3933/ambari-agent/src/test/python/ambari_agent/TestProcessHelper.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestProcessHelper.py b/ambari-agent/src/test/python/ambari_agent/TestProcessHelper.py
index 35af423..b0b828d 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestProcessHelper.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestProcessHelper.py
@@ -47,13 +47,13 @@ class TestProcessHelper(unittest.TestCase):
     self.assertFalse(os.path.exists(tf3.name))
 
 
-  @patch("os._exit")
+  @patch("sys.exit")
   @patch.object(ProcessHelper, "_clean")
-  def test_stopAgent(self, _clean_mock, exitMock):
+  def test_stopAgent(self, _clean_mock, sys_exit_mock):
 
     ProcessHelper.stopAgent()
     self.assertTrue(_clean_mock.called)
-    self.assertTrue(exitMock.called)
+    self.assertTrue(sys_exit_mock.called)
 
 
   @patch("os.execvp")