ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [ambari] 01/02: AMBARI-23373. Fix formatZKFC (aonishuk)
Date Fri, 30 Mar 2018 08:37:44 GMT
This is an automated email from the ASF dual-hosted git repository.

aonishuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit cd7814aa3d6db1f6db0a49a5a07cb809d92018d0
Author: Andrew Onishuk <aonishuk@hortonworks.com>
AuthorDate: Tue Mar 27 14:42:00 2018 +0300

    AMBARI-23373. Fix formatZKFC (aonishuk)
---
 .../HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py   | 23 ++++++++++------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
index aed240a..dcfad7e 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
@@ -35,6 +35,7 @@ from resource_management.libraries.script import Script
 from resource_management.core.resources.zkmigrator import ZkMigrator
 from resource_management.core.resources.system import Execute
 from resource_management.core.exceptions import Fail, ComponentIsNotRunning
+from resource_management.core.resources.system import Execute
 
 
 class ZkfcSlave(Script):
@@ -54,6 +55,15 @@ class ZkfcSlave(Script):
     utils.set_up_zkfc_security(params)
     pass
 
+  def format(self, env):
+    import params
+    env.set_params(params)
+
+    Execute("hdfs zkfc -formatZK",
+            user=params.hdfs_user,
+            logoutput=True
+    )
+
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ZkfcSlaveDefault(ZkfcSlave):
 
@@ -137,19 +147,6 @@ class ZkfcSlaveDefault(ZkfcSlave):
     env.set_params(params)
     if check_stack_feature(StackFeature.ZKFC_VERSION_ADVERTISED, params.version_for_stack_feature_checks):
       stack_select.select_packages(params.version)
-      
-  def format(self, env):
-    import params
-    env.set_params(params)
-
-    try:
-      self.status(env)
-      raise Fail("ZKFC is running. Cannot format it.")
-    except ComponentIsNotRunning:
-      Execute("hdfs zkfc -formatZK",
-              user=params.hdfs_user,
-              logoutput=True
-      )
 
 def initialize_ha_zookeeper(params):
   try:

-- 
To stop receiving notification emails like this one, please contact
aonishuk@apache.org.

Mime
View raw message