Repository: ambari Updated Branches: refs/heads/trunk 85c751557 -> c4d5ff90c
AMBARI-14110. Clean up stop agent to not print unnecessary error message.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c4d5ff90 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c4d5ff90 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c4d5ff90 Branch: refs/heads/trunk Commit: c4d5ff90c1946cfbff81200bff2376b372bc7fff Parents: 85c7515 Author: Vitaly Brodetskyi <[email protected]> Authored: Mon Nov 30 09:51:17 2015 +0200 Committer: Vitaly Brodetskyi <[email protected]> Committed: Mon Nov 30 09:51:17 2015 +0200 ---------------------------------------------------------------------- ambari-agent/src/main/python/ambari_agent/main.py | 2 +- ambari-agent/src/test/python/ambari_agent/TestMain.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c4d5ff90/ambari-agent/src/main/python/ambari_agent/main.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/ambari_agent/main.py b/ambari-agent/src/main/python/ambari_agent/main.py index 74697c5..731cbfc 100644 --- a/ambari-agent/src/main/python/ambari_agent/main.py +++ b/ambari-agent/src/main/python/ambari_agent/main.py @@ -189,7 +189,7 @@ def stop_agent(): res = runner.run([AMBARI_SUDO_BINARY, 'kill', '-9', str(pid)]) if res['exitCode'] != 0: raise Exception("Error while performing agent stop. " + res['error'] + res['output']) - sys.exit(1) + sys.exit(0) def reset_agent(options): try: http://git-wip-us.apache.org/repos/asf/ambari/blob/c4d5ff90/ambari-agent/src/test/python/ambari_agent/TestMain.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/test/python/ambari_agent/TestMain.py b/ambari-agent/src/test/python/ambari_agent/TestMain.py index 696e597..d044027 100644 --- a/ambari-agent/src/test/python/ambari_agent/TestMain.py +++ b/ambari-agent/src/test/python/ambari_agent/TestMain.py @@ -232,7 +232,7 @@ class TestMain(unittest.TestCase): main.stop_agent() kill_mock.assert_any_call(['ambari-sudo.sh', 'kill', '-15', pid]) kill_mock.assert_any_call(['ambari-sudo.sh', 'kill', '-9', pid]) - sys_exit_mock.assert_called_with(1) + sys_exit_mock.assert_called_with(0) # Restore ProcessHelper.pidfile = oldpid
