Repository: ambari
Updated Branches:
  refs/heads/trunk 6eb571c2b -> ef040d68a


AMBARI-9745. Storm JAVA_HOME not updating after config change in Ambari 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: ef040d68a727aa766eda662e6d75bdd862c89366
Parents: 6eb571c
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Mon Feb 23 15:14:54 2015 +0200
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Mon Feb 23 15:14:54 2015 +0200

----------------------------------------------------------------------
 .../STORM/0.9.1.2.1/package/scripts/service.py  |  5 ++--
 .../0.9.1.2.1/package/scripts/service_check.py  |  4 ++--
 .../stacks/2.1/STORM/test_service_check.py      |  4 ++--
 .../stacks/2.1/STORM/test_storm_drpc_server.py  | 20 ++++++++--------
 .../stacks/2.1/STORM/test_storm_nimbus.py       | 20 ++++++++--------
 .../2.1/STORM/test_storm_rest_api_service.py    | 22 ++++++++---------
 .../stacks/2.1/STORM/test_storm_supervisor.py   | 25 ++++++++++----------
 .../2.1/STORM/test_storm_supervisor_prod.py     | 20 ++++++++--------
 .../stacks/2.1/STORM/test_storm_ui_server.py    | 21 ++++++++--------
 9 files changed, 70 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service.py
 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service.py
index 781c7ef..2822ef6 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service.py
+++ 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service.py
@@ -49,13 +49,14 @@ def service(
   find_proc = format("{jps_binary} -l  | grep {process_grep}")
   write_pid = format("{find_proc} | awk {{'print $1'}} > {pid_file}")
   crt_pid_cmd = format("{find_proc} && {write_pid}")
+  storm_env = format("source {conf_dir}/storm-env.sh ; export 
PATH=$PATH:$JAVA_HOME/bin")
 
   if action == "start":
     if name == "rest_api":
-      process_cmd = format("{java64_home}/bin/java -jar {rest_lib_dir}/`ls 
{rest_lib_dir} | grep -wE storm-rest-[0-9.-]+\.jar` server")
+      process_cmd = format("{storm_env} ; java -jar {rest_lib_dir}/`ls 
{rest_lib_dir} | grep -wE storm-rest-[0-9.-]+\.jar` server")
       cmd = format("{process_cmd} {rest_api_conf_file} > {log_dir}/restapi.log 
2>&1")
     else:
-      cmd = format("env JAVA_HOME={java64_home} PATH=$PATH:{java64_home}/bin 
storm {name} > {log_dir}/{name}.out 2>&1")
+      cmd = format("{storm_env} ; storm {name} > {log_dir}/{name}.out 2>&1")
 
     Execute(cmd,
            not_if=no_op_test,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service_check.py
index 6f953d1..4eec899 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/service_check.py
@@ -36,7 +36,7 @@ class ServiceCheck(Script):
          content=StaticFile("wordCount.jar")
     )
 
-    cmd = format("env JAVA_HOME={java64_home} storm jar /tmp/wordCount.jar 
storm.starter.WordCountTopology WordCount{unique} -c nimbus.host={nimbus_host}")
+    cmd = format("storm jar /tmp/wordCount.jar storm.starter.WordCountTopology 
WordCount{unique} -c nimbus.host={nimbus_host}")
 
     Execute(cmd,
             logoutput=True,
@@ -44,7 +44,7 @@ class ServiceCheck(Script):
             user=params.storm_user
     )
 
-    Execute(format("env JAVA_HOME={java64_home} storm kill WordCount{unique}"),
+    Execute(format("storm kill WordCount{unique}"),
             path=params.storm_bin_dir,
             user=params.storm_user
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
index 5686196..93561ff 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
@@ -40,12 +40,12 @@ class TestStormServiceCheck(TestStormBase):
     self.assertResourceCalled('File', '/tmp/wordCount.jar',
       content = StaticFile('wordCount.jar'),
     )
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
storm jar /tmp/wordCount.jar storm.starter.WordCountTopology WordCount -c 
nimbus.host=c6402.ambari.apache.org',
+    self.assertResourceCalled('Execute', 'storm jar /tmp/wordCount.jar 
storm.starter.WordCountTopology WordCount -c 
nimbus.host=c6402.ambari.apache.org',
       logoutput = True,
       path = ['/usr/bin'],
       user = 'storm'
     )
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
storm kill WordCount',
+    self.assertResourceCalled('Execute', 'storm kill WordCount',
       path = ['/usr/bin'],
       user = 'storm'
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
index 1113409..87fc953 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
@@ -48,11 +48,11 @@ class TestStormDrpcServer(TestStormBase):
     )
     self.assert_configure_default()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm drpc > /var/log/storm/drpc.out 
2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/drpc.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/drpc.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm drpc > /var/log/storm/drpc.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/drpc.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/drpc.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.drpc$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.drpc$ | awk {'print $1'} > /var/run/storm/drpc.pid",
         logoutput = True,
@@ -106,11 +106,11 @@ class TestStormDrpcServer(TestStormBase):
 
     self.assert_configure_secured()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm drpc > /var/log/storm/drpc.out 
2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/drpc.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/drpc.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm drpc > /var/log/storm/drpc.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/drpc.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/drpc.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.drpc$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.drpc$ | awk {'print $1'} > /var/run/storm/drpc.pid",
         logoutput = True,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
index e607499..069c2d3 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
@@ -48,11 +48,11 @@ class TestStormNimbus(TestStormBase):
 
     self.assert_configure_default()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm nimbus > /var/log/storm/nimbus.out 
2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/nimbus.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/nimbus.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm nimbus > /var/log/storm/nimbus.out 
2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/nimbus.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/nimbus.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.nimbus$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.nimbus$ | awk {'print $1'} > /var/run/storm/nimbus.pid",
         logoutput = True,
@@ -105,11 +105,11 @@ class TestStormNimbus(TestStormBase):
 
     self.assert_configure_secured()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm nimbus > /var/log/storm/nimbus.out 
2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/nimbus.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/nimbus.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm nimbus > /var/log/storm/nimbus.out 
2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/nimbus.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/nimbus.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.nimbus$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.nimbus$ | awk {'print $1'} > /var/run/storm/nimbus.pid",
         logoutput = True,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
index d4d549e..d6b26da 100644
--- 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
+++ 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
@@ -47,11 +47,12 @@ class TestStormRestApi(TestStormBase):
 
     self.assert_configure_default()
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -jar 
/usr/lib/storm/contrib/storm-rest/`ls /usr/lib/storm/contrib/storm-rest | grep 
-wE storm-rest-[0-9.-]+\\.jar` server /etc/storm/conf/config.yaml > 
/var/log/storm/restapi.log 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/restapi.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/restapi.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; java -jar 
/usr/lib/storm/contrib/storm-rest/`ls /usr/lib/storm/contrib/storm-rest | grep 
-wE storm-rest-[0-9.-]+\\.jar` server /etc/storm/conf/config.yaml > 
/var/log/storm/restapi.log 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/restapi.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/restapi.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep /usr/lib/storm/contrib/storm-rest/storm-rest-.*\\.jar$ && 
/usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
/usr/lib/storm/contrib/storm-rest/storm-rest-.*\\.jar$ | awk {'print $1'} > 
/var/run/storm/restapi.pid",
         logoutput = True,
@@ -104,13 +105,12 @@ class TestStormRestApi(TestStormBase):
 
     self.assert_configure_secured()
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -jar 
/usr/lib/storm/contrib/storm-rest/`ls /usr/lib/storm/contrib/storm-rest | grep 
-wE storm-rest-[0-9.-]+\\.jar` server /etc/storm/conf/config.yaml > 
/var/log/storm/restapi.log 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/restapi.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/restapi.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; java -jar 
/usr/lib/storm/contrib/storm-rest/`ls /usr/lib/storm/contrib/storm-rest | grep 
-wE storm-rest-[0-9.-]+\\.jar` server /etc/storm/conf/config.yaml > 
/var/log/storm/restapi.log 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/restapi.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/restapi.pid` >/dev/null 2>&1',
     )
-
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep /usr/lib/storm/contrib/storm-rest/storm-rest-.*\\.jar$ && 
/usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
/usr/lib/storm/contrib/storm-rest/storm-rest-.*\\.jar$ | awk {'print $1'} > 
/var/run/storm/restapi.pid",
         logoutput = True,
         path = ['/usr/bin'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
index 9e5f47c..f954219 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
@@ -47,11 +47,11 @@ class TestStormSupervisor(TestStormBase):
 
     self.assert_configure_default()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm supervisor > 
/var/log/storm/supervisor.out 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/supervisor.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/supervisor.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm supervisor > 
/var/log/storm/supervisor.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/supervisor.pid >/dev/null 2>&1 && ps -p 
`cat /var/run/storm/supervisor.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.supervisor$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.supervisor$ | awk {'print $1'} > /var/run/storm/supervisor.pid",
         logoutput = True,
@@ -60,7 +60,7 @@ class TestStormSupervisor(TestStormBase):
         user = 'storm',
         try_sleep = 10,
     )
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
         wait_for_finish = False,
         path = ['/usr/bin'],
         user = 'storm',
@@ -127,13 +127,12 @@ class TestStormSupervisor(TestStormBase):
 
     self.assert_configure_secured()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm supervisor > 
/var/log/storm/supervisor.out 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/supervisor.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/supervisor.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm supervisor > 
/var/log/storm/supervisor.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/supervisor.pid >/dev/null 2>&1 && ps -p 
`cat /var/run/storm/supervisor.pid` >/dev/null 2>&1',
     )
-
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.supervisor$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.supervisor$ | awk {'print $1'} > /var/run/storm/supervisor.pid",
         logoutput = True,
         path = ['/usr/bin'],
@@ -141,7 +140,7 @@ class TestStormSupervisor(TestStormBase):
         user = 'storm',
         try_sleep = 10,
     )
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
         wait_for_finish = False,
         path = ['/usr/bin'],
         user = 'storm',

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
index dd774a8..301d6a3 100644
--- 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
+++ 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
@@ -50,11 +50,11 @@ class TestStormSupervisor(TestStormBase):
     self.assertResourceCalled('Execute', 'supervisorctl start 
storm-supervisor',
       wait_for_finish = False,
     )
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/logviewer.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/logviewer.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/logviewer.pid >/dev/null 2>&1 && ps -p 
`cat /var/run/storm/logviewer.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.logviewer$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.logviewer$ | awk {'print $1'} > /var/run/storm/logviewer.pid",
         logoutput = True,
@@ -113,11 +113,11 @@ class TestStormSupervisor(TestStormBase):
     self.assertResourceCalled('Execute', 'supervisorctl start 
storm-supervisor',
                         wait_for_finish = False,
     )
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/logviewer.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/logviewer.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm logviewer > 
/var/log/storm/logviewer.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/logviewer.pid >/dev/null 2>&1 && ps -p 
`cat /var/run/storm/logviewer.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep storm.daemon.logviewer$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
storm.daemon.logviewer$ | awk {'print $1'} > /var/run/storm/logviewer.pid",
         logoutput = True,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef040d68/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
index 8a04369..251eae5 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
@@ -46,11 +46,11 @@ class TestStormUiServer(TestStormBase):
 
     self.assert_configure_default()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm ui > /var/log/storm/ui.out 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/ui.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/ui.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm ui > /var/log/storm/ui.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/ui.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/ui.pid` >/dev/null 2>&1',
     )
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep backtype.storm.ui.core$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
backtype.storm.ui.core$ | awk {'print $1'} > /var/run/storm/ui.pid",
         logoutput = True,
@@ -103,13 +103,12 @@ class TestStormUiServer(TestStormBase):
 
     self.assert_configure_secured()
 
-    self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 
PATH=$PATH:/usr/jdk64/jdk1.7.0_45/bin storm ui > /var/log/storm/ui.out 2>&1',
-      wait_for_finish = False,
-      not_if = 'ls /var/run/storm/ui.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/ui.pid` >/dev/null 2>&1',
-      path = ['/usr/bin'],
-      user = 'storm',
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh 
; export PATH=$PATH:$JAVA_HOME/bin ; storm ui > /var/log/storm/ui.out 2>&1',
+        wait_for_finish = False,
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = 'ls /var/run/storm/ui.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/storm/ui.pid` >/dev/null 2>&1',
     )
-
     self.assertResourceCalled('Execute', "/usr/jdk64/jdk1.7.0_45/bin/jps -l  | 
grep backtype.storm.ui.core$ && /usr/jdk64/jdk1.7.0_45/bin/jps -l  | grep 
backtype.storm.ui.core$ | awk {'print $1'} > /var/run/storm/ui.pid",
         logoutput = True,
         path = ['/usr/bin'],

Reply via email to