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 2014/05/07 14:57:36 UTC
[2/2] git commit: AMBARI-5593. Mysql install fails on Ubuntu
(aonishuk)
AMBARI-5593. Mysql install fails on Ubuntu (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/afce4809
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/afce4809
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/afce4809
Branch: refs/heads/trunk
Commit: afce48094c3388063ed963556e491aa18b965aae
Parents: f3e6055
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed May 7 15:57:07 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed May 7 15:57:07 2014 +0300
----------------------------------------------------------------------
.../services/HIVE/package/scripts/mysql_service.py | 13 +++++++------
.../test/python/stacks/2.0.6/HIVE/test_mysql_server.py | 12 ++++++------
2 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/afce4809/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_service.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_service.py
index c0ce7f6..f06fa71 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_service.py
@@ -22,19 +22,20 @@ from resource_management import *
def mysql_service(daemon_name=None, action='start'):
+ status_cmd = format('service {daemon_name} status | grep running')
+ cmd = format('service {daemon_name} {action}')
if action == 'status':
- logoutput = False
+ Execute(status_cmd)
else:
- logoutput = True
# required for running hive
replace_bind_address = format("sed -i 's|^bind-address[ \t]*=.*|bind-address = 0.0.0.0|' {mysql_configname}")
Execute(replace_bind_address)
- cmd = format('service {daemon_name} {action}')
- Execute(cmd,
- tries=1,
- logoutput=logoutput)
+ Execute(cmd,
+ logoutput = True,
+ not_if = status_cmd
+ )
http://git-wip-us.apache.org/repos/asf/ambari/blob/afce4809/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 c6d50fc..67a5d23 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
@@ -42,7 +42,7 @@ class TestMySqlServer(RMFTestCase):
)
self.assertResourceCalled('Execute', 'service mysql start',
logoutput = True,
- tries = 1,
+ not_if = 'service mysql status | grep running'
)
self.assertNoMoreResources()
@@ -57,7 +57,7 @@ class TestMySqlServer(RMFTestCase):
)
self.assertResourceCalled('Execute', 'service mysql stop',
logoutput = True,
- tries = 1,
+ not_if = 'service mysql status | grep running',
)
self.assertNoMoreResources()
@@ -82,7 +82,7 @@ class TestMySqlServer(RMFTestCase):
)
self.assertResourceCalled('Execute', 'service mysql start',
logoutput = True,
- tries = 1,
+ not_if = 'service mysql status | grep running'
)
self.assertNoMoreResources()
@@ -97,7 +97,7 @@ class TestMySqlServer(RMFTestCase):
)
self.assertResourceCalled('Execute', 'service mysql stop',
logoutput = True,
- tries = 1,
+ not_if = 'service mysql status | grep running'
)
self.assertNoMoreResources()
@@ -106,7 +106,7 @@ class TestMySqlServer(RMFTestCase):
)
self.assertResourceCalled('Execute', 'service mysql start',
logoutput = True,
- tries = 1,
+ not_if = 'service mysql status | grep running'
)
self.assertResourceCalled('File', '/tmp/addMysqlUser.sh',
content = StaticFile('addMysqlUser.sh'),
@@ -123,7 +123,7 @@ class TestMySqlServer(RMFTestCase):
)
self.assertResourceCalled('Execute', 'service mysql start',
logoutput = True,
- tries = 1,
+ not_if = 'service mysql status | grep running'
)
self.assertResourceCalled('File', '/tmp/addMysqlUser.sh',
content = StaticFile('addMysqlUser.sh'),