ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-12086. Remove/review other occurrences of Execute (format("rm -f {pid_file}")) for non-root agent (aonishuk)
Date Wed, 24 Jun 2015 17:16:10 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8a7b84520 -> d7eecaa9f


AMBARI-12086. Remove/review other occurrences of Execute (format("rm -f {pid_file}")) for
non-root agent (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: d7eecaa9f5c073e01b3cb70a687dd7d92f299a46
Parents: 8a7b845
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Jun 24 20:14:56 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Jun 24 20:16:02 2015 +0300

----------------------------------------------------------------------
 .../AMBARI_METRICS/0.1.0/package/scripts/hbase_service.py    | 4 +++-
 .../HBASE/0.96.0.2.0/package/scripts/phoenix_service.py      | 5 ++++-
 .../python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py    | 8 ++++----
 3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7eecaa9/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_service.py
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_service.py
index 180755f..5f03ca0 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_service.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_service.py
@@ -48,4 +48,6 @@ def hbase_service(
         on_timeout = format("{no_op_test} && kill -9 `cat {pid_file}`")
       )
       
-      Execute (format("rm -f {pid_file}"))
+      File(pid_file,
+        action = "delete",
+      )

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7eecaa9/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_service.py
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_service.py
index 8aa1994..e155cec 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_service.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_service.py
@@ -19,6 +19,7 @@ limitations under the License.
 """
 
 from resource_management.core.resources.system import Execute
+from resource_management.core.resources.system import File
 from resource_management.libraries.functions import check_process_status, format
 
 # Note: Phoenix Query Server is only applicable to HDP-2.3 and above.
@@ -44,4 +45,6 @@ def phoenix_service(action = 'start'): # 'start', 'stop', 'status'
                 user=format("{hbase_user}"),
                 environment=env
         )
-        Execute(format("rm -f {pid_file}"))
+        File(pid_file,
+             action = "delete"
+        )

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7eecaa9/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
index 436660e..c0a1686 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
@@ -81,8 +81,8 @@ class TestPhoenixQueryServer(RMFTestCase):
       user = 'hbase'
     )
 
-    self.assertResourceCalled('Execute',
-      'rm -f /var/run/hbase/phoenix-hbase-server.pid',
+    self.assertResourceCalled('File', '/var/run/hbase/phoenix-hbase-server.pid',
+        action = ['delete'],
     )
     self.assertNoMoreResources()
 
@@ -136,8 +136,8 @@ class TestPhoenixQueryServer(RMFTestCase):
       user = 'hbase'
     )
 
-    self.assertResourceCalled('Execute',
-      'rm -f /var/run/hbase/phoenix-hbase-server.pid',
+    self.assertResourceCalled('File', '/var/run/hbase/phoenix-hbase-server.pid',
+        action = ['delete'],
     )
     self.assertNoMoreResources()
 


Mime
View raw message