ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stoa...@apache.org
Subject ambari git commit: AMBARI-15744. Webhcat Server failed to stop while stopping all the services. (part2) (stoader)
Date Thu, 07 Apr 2016 13:10:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 6568b583d -> 0e8715179


AMBARI-15744. Webhcat Server failed to stop while stopping all the services. (part2) (stoader)


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

Branch: refs/heads/trunk
Commit: 0e87151795a9bf97f8b7ef8033204b03f08ab91b
Parents: 6568b58
Author: Toader, Sebastian <stoader@hortonworks.com>
Authored: Thu Apr 7 15:08:37 2016 +0200
Committer: Toader, Sebastian <stoader@hortonworks.com>
Committed: Thu Apr 7 15:08:37 2016 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/webhcat_service.py         | 6 +++++-
 .../src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py   | 5 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e871517/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
index 487f078..2412c15 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py
@@ -22,6 +22,9 @@ from resource_management import *
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from ambari_commons import OSConst
 from resource_management.core.shell import as_user
+from resource_management.core.logger import Logger
+import traceback
+
 
 @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
 def webhcat_service(action='start', rolling_restart=False):
@@ -57,8 +60,9 @@ def webhcat_service(action='start', upgrade_type=None):
   elif action == 'stop':
     try:
       graceful_stop(cmd, environ)
-    except:
+    except Fail:
       show_logs(params.hcat_log_dir, params.webhcat_user)
+      Logger.info(traceback.format_exc())
 
     pid_expression = "`" + as_user(format("cat {webhcat_pid_file}"), user=params.webhcat_user)
+ "`"
     process_id_exists_command = format("ls {webhcat_pid_file} >/dev/null 2>&1 &&
ps -p {pid_expression} >/dev/null 2>&1")

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e871517/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
index 86f185d..edc25de 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
@@ -20,6 +20,7 @@ limitations under the License.
 import json
 from mock.mock import MagicMock, patch
 from stacks.utils.RMFTestCase import *
+from resource_management.core.exceptions import Fail
 
 @patch("os.path.isfile", new = MagicMock(return_value=True))
 @patch("glob.glob", new = MagicMock(return_value=["one", "two"]))
@@ -95,7 +96,7 @@ class TestWebHCatServer(RMFTestCase):
       self.assert_configure_secured()
       self.assertNoMoreResources()
 
-  @patch("webhcat_service.graceful_stop", new = MagicMock(side_effect=Exception))
+  @patch("webhcat_service.graceful_stop", new = MagicMock(side_effect=Fail))
   def test_stop_graceful_stop_failed(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/webhcat_server.py",
                        classname = "WebHCatServer",
@@ -169,7 +170,7 @@ class TestWebHCatServer(RMFTestCase):
     )
     self.assertNoMoreResources()
 
-  @patch("webhcat_service.graceful_stop", new = MagicMock(side_effect=Exception))
+  @patch("webhcat_service.graceful_stop", new = MagicMock(side_effect=Fail))
   def test_stop_secured_graceful_stop_failed(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/webhcat_server.py",
                        classname = "WebHCatServer",


Mime
View raw message