You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/02/12 14:13:36 UTC

ambari git commit: AMBARI-9595. Ambari greps 'running' for service daemon status, which does not apply to certain services/platforms (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 1cd12ce36 -> f95eb9529


AMBARI-9595. Ambari greps 'running' for service daemon status, which does not apply to certain services/platforms (aonishuk)


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

Branch: refs/heads/trunk
Commit: f95eb95295668eab7a56f8e24378f83675ccd60a
Parents: 1cd12ce
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Feb 12 15:13:28 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Feb 12 15:13:28 2015 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/f95eb952/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_service.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_service.py
index f908c75..136fe03 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_service.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_service.py
@@ -22,7 +22,7 @@ from resource_management import *
 
 
 def mysql_service(daemon_name=None, action='start'): 
-  status_cmd = format('service {daemon_name} status | grep running')
+  status_cmd = format("pgrep -l '^{daemon_name}$'")
   cmd = ('service', daemon_name, action)
 
   if action == 'status':

http://git-wip-us.apache.org/repos/asf/ambari/blob/f95eb952/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
index bb1f235..d0d701f 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
@@ -46,7 +46,7 @@ class TestMySqlServer(RMFTestCase):
 
     self.assertResourceCalled('Execute', ('service','mysql','start'),
                        logoutput = True,
-                       not_if = 'service mysql status | grep running',
+                       not_if = 'pgrep -l \'^mysql$\'',
                        sudo = True,
     )
     self.assertNoMoreResources()
@@ -61,7 +61,7 @@ class TestMySqlServer(RMFTestCase):
     )
     self.assertResourceCalled('Execute', ('service','mysql','stop'),
                               logoutput = True,
-                              only_if = 'service mysql status | grep running',
+                              only_if = 'pgrep -l \'^mysql$\'',
                               sudo = True,
     )
     self.assertNoMoreResources()
@@ -89,7 +89,7 @@ class TestMySqlServer(RMFTestCase):
 
     self.assertResourceCalled('Execute', ('service','mysql','start'),
                               logoutput = True,
-                              not_if = 'service mysql status | grep running',
+                              not_if = 'pgrep -l \'^mysql$\'',
                               sudo = True,
                               )
     self.assertNoMoreResources()
@@ -105,7 +105,7 @@ class TestMySqlServer(RMFTestCase):
     
     self.assertResourceCalled('Execute', ('service','mysql','stop'),
                               logoutput = True,
-                              only_if = 'service mysql status | grep running',
+                              only_if = 'pgrep -l \'^mysql$\'',
                               sudo = True,
                               )
     self.assertNoMoreResources()