ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhuvnesh2...@apache.org
Subject ambari git commit: AMBARI-15524: exchange keys should be done only from HAWQMASTER (bhuvnesh2703)
Date Thu, 24 Mar 2016 03:54:25 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 c313536a9 -> 2c84b99ec


AMBARI-15524: exchange keys should be done only from HAWQMASTER (bhuvnesh2703)


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

Branch: refs/heads/branch-2.2
Commit: 2c84b99ec853e5334a9d689a3188ced82f387d21
Parents: c313536
Author: Bhuvnesh Chaudhary <bchaudhary@pivotal.io>
Authored: Wed Mar 23 20:55:17 2016 -0700
Committer: Bhuvnesh Chaudhary <bchaudhary@pivotal.io>
Committed: Wed Mar 23 20:55:17 2016 -0700

----------------------------------------------------------------------
 .../HAWQ/2.0.0/package/scripts/common.py        |  36 ++++++
 .../HAWQ/2.0.0/package/scripts/hawqmaster.py    |  10 +-
 .../HAWQ/2.0.0/package/scripts/hawqsegment.py   |  41 +------
 .../HAWQ/2.0.0/package/scripts/hawqstandby.py   |   6 +-
 .../HAWQ/2.0.0/package/scripts/master_helper.py | 117 +------------------
 .../python/stacks/2.3/HAWQ/test_hawqmaster.py   |  78 +------------
 .../python/stacks/2.3/HAWQ/test_hawqsegment.py  |  22 ++--
 .../python/stacks/2.3/HAWQ/test_hawqstandby.py  |  20 +---
 8 files changed, 73 insertions(+), 257 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
index 20336bc..ad1f990 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
@@ -256,3 +256,39 @@ def validate_configuration():
     raise Fail("HAWQ is set to use YARN but YARN is not deployed. " + 
                "hawq_global_rm_type property in hawq-site is set to 'yarn' but YARN is not
configured. " + 
                "Please deploy YARN before starting HAWQ or change the value of hawq_global_rm_type
property to 'none'")
+
+def __init_component(component_name):
+  """
+  Initializes the HAWQ component and creates hdfs data directory if master is being initialized
+  """
+  import params
+  if component_name == hawq_constants.MASTER:
+    data_dir_owner = hawq_constants.hawq_user_secured if params.security_enabled else hawq_constants.hawq_user
+    params.HdfsResource(params.hawq_hdfs_data_dir,
+                        type="directory",
+                        action="create_on_execute",
+                        owner=data_dir_owner,
+                        group=hawq_constants.hawq_group,
+                        recursive_chown = True,
+                        mode=0755)
+    params.HdfsResource(None, action="execute")
+  utils.exec_hawq_operation(hawq_constants.INIT, "{0} -a -v".format(component_name))
+
+
+def start_component(component_name, port, data_dir):
+  """
+  If data directory exists start the component, else initialize the component
+  """
+  if os.path.exists(os.path.join(data_dir, hawq_constants.postmaster_opts_filename)):
+    return utils.exec_hawq_operation(hawq_constants.START,
+                                     "{0} -a -v".format(component_name),
+                                     not_if=utils.chk_hawq_process_status_cmd(port))
+  __init_component(component_name)
+
+def stop_component(component_name, port, mode):
+  """
+  Stops the component
+  """
+  utils.exec_hawq_operation(hawq_constants.STOP,
+                            "{0} -M {1} -a -v".format(component_name, mode),
+                            only_if=utils.chk_hawq_process_status_cmd(port, component_name))

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
index 8c42848..cd973c1 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
@@ -47,19 +47,23 @@ class HawqMaster(Script):
     master_helper.configure_master()
 
   def start(self, env):
+    import params
     self.configure(env)
     common.validate_configuration()
-    master_helper.start_master()
+    master_helper.setup_passwordless_ssh()
+    common.start_component(hawq_constants.MASTER, params.hawq_master_address_port, params.hawq_master_dir)
 
   def stop(self, env):
-    master_helper.stop()
+    import params
+    common.stop_component(hawq_constants.MASTER, params.hawq_master_address_port, hawq_constants.FAST)
 
   def status(self, env):
     from hawqstatus import get_pid_file
     check_process_status(get_pid_file())
 
   def immediate_stop_hawq_service(self, env):
-    master_helper.stop(hawq_constants.IMMEDIATE, hawq_constants.CLUSTER)
+    import params
+    common.stop_component(hawq_constants.CLUSTER, params.hawq_master_address_port, hawq_constants.IMMEDIATE)
 
   def hawq_clear_cache(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqsegment.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqsegment.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqsegment.py
index 1891ede..28946f1 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqsegment.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqsegment.py
@@ -42,33 +42,19 @@ class HawqSegment(Script):
     env.set_params(hawq_constants)
     common.setup_user()
     common.setup_common_configurations()
+    common.create_master_dir(params.hawq_segment_dir)
     # temp directories are stateless and they should be recreated when configured (started)
     common.create_temp_dirs(params.hawq_segment_temp_dirs)
 
-
-  def __start_segment(self):
-    import params
-    return utils.exec_hawq_operation(
-          hawq_constants.START, 
-          "{0} -a -v".format(hawq_constants.SEGMENT), 
-          not_if=utils.chk_hawq_process_status_cmd(params.hawq_segment_address_port))
-
   def start(self, env):
+    import params
     self.configure(env)
     common.validate_configuration()
-
-    if self.__is_segment_initialized():
-      self.__start_segment()
-      return
-
-    # Initialization also starts process.
-    self.__init_segment()
-
+    common.start_component(hawq_constants.SEGMENT, params.hawq_segment_address_port, params.hawq_segment_dir)
 
   def stop(self, env, mode=hawq_constants.FAST):
     import params
-    utils.exec_hawq_operation(hawq_constants.STOP, "{0} -M {1} -a -v".format(hawq_constants.SEGMENT,
mode), only_if=utils.chk_hawq_process_status_cmd(
-                                params.hawq_segment_address_port))
+    common.stop_component(hawq_constants.SEGMENT, params.hawq_segment_address_port, mode)
 
 
   def status(self, env):
@@ -76,24 +62,7 @@ class HawqSegment(Script):
     check_process_status(get_pid_file())
 
   def immediate_stop_hawq_segment(self, env):
-    self.stop(env, mode=hawq_constants.IMMEDIATE)
-
-
-  @staticmethod
-  def __init_segment():
-    import params
-    common.create_master_dir(params.hawq_segment_dir)
-
-    # Initialize hawq segment
-    utils.exec_hawq_operation(hawq_constants.INIT, "{0} -a -v".format(hawq_constants.SEGMENT))
-
-  def __is_segment_initialized(self):
-    """
-    Check whether the HAWQ Segment is initialized
-    """
-    import params
-    return os.path.exists(os.path.join(params.hawq_segment_dir, hawq_constants.postmaster_opts_filename))
-
+    self.stop(env, hawq_constants.IMMEDIATE)
 
 if __name__ == "__main__":
   HawqSegment().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
index 77c06f0..db155a0 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
@@ -41,12 +41,14 @@ class HawqStandby(Script):
     master_helper.configure_master()
 
   def start(self, env):
+    import params
     self.configure(env)
     common.validate_configuration()
-    master_helper.start_master()
+    common.start_component(hawq_constants.STANDBY, params.hawq_master_address_port, params.hawq_master_dir)
 
   def stop(self, env):
-    master_helper.stop()
+    import params
+    common.stop_component(hawq_constants.STANDBY, params.hawq_master_address_port, hawq_constants.FAST)
 
   def status(self, env):
     from hawqstatus import get_pid_file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
index 330b6c0..fc51693 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
@@ -17,9 +17,7 @@ limitations under the License.
 """
 import os
 import sys
-from resource_management.core.resources.system import File, Execute
 from resource_management.core.source import InlineTemplate
-from resource_management.core.exceptions import Fail
 from resource_management.core.logger import Logger
 from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions.default import default
@@ -44,7 +42,7 @@ def __setup_master_specific_conf_files():
               content=InlineTemplate("{% for host in hawq_all_hosts %}{{host}}\n{% endfor
%}"))
 
 
-def __setup_passwordless_ssh():
+def setup_passwordless_ssh():
   """
   Exchanges ssh keys to setup passwordless ssh for the hawq_user between the HAWQ Master
and the HAWQ Segment nodes
   """
@@ -56,12 +54,13 @@ def configure_master():
   """
   Configures the master node after rpm install
   """
+  import params
   common.setup_user()
   common.setup_common_configurations()
   __setup_master_specific_conf_files()
-  import params
   common.create_master_dir(params.hawq_master_dir)
   common.create_temp_dirs(params.hawq_master_temp_dirs)
+  __check_dfs_truncate_enforced()
 
 def __setup_hdfs_dirs():
   """
@@ -82,80 +81,6 @@ def __setup_hdfs_dirs():
   params.HdfsResource(None, action="execute")
 
 
-def __init_active():
-  """
-  Initializes the active master
-  """
-  import params
-  __setup_hdfs_dirs()
-  utils.exec_hawq_operation(hawq_constants.INIT, "{0} -a -v".format(hawq_constants.MASTER))
-  Logger.info("Active master {0} initialized".format(params.hostname))
-
-
-def __init_standby():
-  """
-  Initializes the HAWQ Standby Master
-  """
-  import params
-  utils.exec_hawq_operation(hawq_constants.INIT, "{0} -a -v".format(hawq_constants.STANDBY))
-  Logger.info("Standby host {0} initialized".format(params.hostname))
-
-
-def __get_component_name():
-  """
-  Identifies current node as either HAWQ Master or HAWQ Standby Master
-  """
-  return hawq_constants.MASTER if __is_active_master() else hawq_constants.STANDBY
-
-
-def __start_local_master():
-  """
-  Starts HAWQ Master or HAWQ Standby Master component on the host
-  """
-  import params
-  component_name = __get_component_name()
-
-  __setup_hdfs_dirs()
-
-  utils.exec_hawq_operation(
-        hawq_constants.START,
-        "{0} -a -v".format(component_name),
-        not_if=utils.chk_hawq_process_status_cmd(params.hawq_master_address_port, component_name))
-  Logger.info("Master {0} started".format(params.hostname))
-
-
-def __is_local_initialized():
-  """
-  Checks if the local node has been initialized
-  """
-  import params
-  return os.path.exists(os.path.join(params.hawq_master_dir, hawq_constants.postmaster_opts_filename))
-
-
-def __get_standby_host():
-  """
-  Returns the name of the HAWQ Standby Master host from hawq-site.xml, or None if no standby
is configured
-  """
-  standby_host = common.get_local_hawq_site_property("hawq_standby_address_host")
-  return None if standby_host is None or standby_host.lower() == 'none' else standby_host
-
-
-def __is_active_master():
-  """
-  Finds if this node is the active master
-  """
-  import params
-  return params.hostname == common.get_local_hawq_site_property("hawq_master_address_host")
-
-
-def __is_standby_host():
-  """
-  Finds if this node is the standby host
-  """
-  import params
-  return params.hostname == common.get_local_hawq_site_property("hawq_standby_address_host")
-
-
 def __check_dfs_truncate_enforced():
   """
   If enforce_hdfs_truncate is set to True:
@@ -176,39 +101,3 @@ def __check_dfs_truncate_enforced():
       sys.exit(1)
     else:
       Logger.warning("**WARNING**: {0}".format(DFS_ALLOW_TRUNCATE_EXCEPTION_MESSAGE))
-
-
-def start_master():
-  """
-  Initializes HAWQ Master/Standby if not already done and starts them
-  """
-  import params
-
-  if not params.hostname in [params.hawqmaster_host, params.hawqstandby_host]:
-    Fail("Host should be either active Hawq master or Hawq standby.")
-
-  __check_dfs_truncate_enforced()
-
-  is_active_master = __is_active_master()
-  __setup_passwordless_ssh()
-
-  if __is_local_initialized():
-    __start_local_master()
-    return
-
-  if is_active_master:
-    __init_active()
-  elif __is_standby_host():
-    __init_standby()
-
-
-def stop(mode=hawq_constants.FAST, component=None):
-  """
-  Stops the HAWQ Master/Standby, if component is cluster performs cluster level operation
from master
-  """
-  import params
-  component_name = component if component else __get_component_name()
-  utils.exec_hawq_operation(
-                hawq_constants.STOP,
-                "{0} -M {1} -a -v".format(component_name, mode),
-                only_if=utils.chk_hawq_process_status_cmd(params.hawq_master_address_port,
component_name))

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
index 4552f3a..4f5cbbd 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
@@ -113,7 +113,8 @@ class TestHawqMaster(RMFTestCase):
 
 
   @patch ('hawqmaster.common.__set_osparams')
-  def test_configure_default(self, set_osparams_mock):
+  @patch ('hawqmaster.master_helper.__check_dfs_truncate_enforced')
+  def test_configure_default(self, set_dfs_truncate_mock, set_osparams_mock):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + '/scripts/hawqmaster.py',
         classname = 'HawqMaster',
@@ -143,11 +144,7 @@ class TestHawqMaster(RMFTestCase):
 
 
   @patch ('hawqmaster.common.__set_osparams')
-  @patch ('hawqmaster.master_helper.__is_active_master')
-  @patch ('hawqmaster.master_helper.__is_local_initialized')
-  def test_start_default(self, is_local_initialized_mock, active_master_mock, set_osparams_mock):
-    active_master_mock.return_value = True
-    is_local_initialized_mock.return_value = False
+  def test_start_default(self, set_osparams_mock):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + '/scripts/hawqmaster.py',
         classname = 'HawqMaster',
@@ -208,74 +205,7 @@ class TestHawqMaster(RMFTestCase):
 
 
   @patch ('hawqmaster.common.__set_osparams')
-  @patch ('hawqmaster.master_helper.__is_active_master')
-  @patch ('hawqmaster.master_helper.__is_local_initialized')
-  def test_start_localmaster(self, is_local_initialized_mock, active_master_mock, set_osparams_mock):
-    active_master_mock.return_value = True
-    is_local_initialized_mock.return_value = True
-
-    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + '/scripts/hawqmaster.py',
-        classname = 'HawqMaster',
-        command = 'start',
-        config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
-        target = RMFTestCase.TARGET_COMMON_SERVICES
-        )
-
-    self.__asserts_for_configure()
-
-    self.assertResourceCalled('Execute', 'source /usr/local/hawq/greenplum_path.sh &&
hawq ssh-exkeys -f /usr/local/hawq/etc/hawq_hosts -p gpadmin',
-        logoutput = True,
-        not_if = None,
-        only_if = None,
-        user = self.GPADMIN,
-        timeout = 900
-        )
-
-    self.assertResourceCalled('HdfsResource', '/hawq_default',
-        immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
-        default_fs = u'hdfs://c6401.ambari.apache.org:8020',
-        hdfs_site = self.getConfig()['configurations']['hdfs-site'],
-        type = 'directory',
-        action = ['create_on_execute'],
-        owner = self.GPADMIN,
-        group = self.GPADMIN,
-        user = u'hdfs',
-        mode = 493,
-        security_enabled = False,
-        kinit_path_local = '/usr/bin/kinit',
-        recursive_chown = True,
-        keytab = UnknownConfigurationMock(),
-        principal_name = UnknownConfigurationMock(),
-        )
-
-    self.assertResourceCalled('HdfsResource', None,
-        immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
-        default_fs = u'hdfs://c6401.ambari.apache.org:8020',
-        hdfs_site = self.getConfig()['configurations']['hdfs-site'],
-        action = ['execute'],
-        user = u'hdfs',
-        security_enabled = False,
-        kinit_path_local = '/usr/bin/kinit',
-        keytab = UnknownConfigurationMock(),
-        principal_name = UnknownConfigurationMock()
-        )
-
-    self.assertResourceCalled('Execute', 'source /usr/local/hawq/greenplum_path.sh &&
hawq start master -a -v',
-        logoutput = True, 
-        not_if = "netstat -tupln | egrep ':5432\\s' | egrep postgres",
-        only_if = None, 
-        user = self.GPADMIN,
-        timeout = 900
-        )
-
-    self.assertNoMoreResources()
-
-
-  @patch ('hawqmaster.common.__set_osparams')
-  @patch ('hawqmaster.master_helper.__is_active_master')
-  def test_stop_default(self, active_master_mock, set_osparams_mock):
-    active_master_mock.return_value = True
+  def test_stop_default(self, set_osparams_mock):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + '/scripts/hawqmaster.py',
         classname = 'HawqMaster',

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
index ac315f2..c212b7d 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
@@ -70,6 +70,17 @@ class TestHawqSegment(RMFTestCase):
         mode = 0644
         )
 
+    self.assertResourceCalled('Directory', '/data/hawq/segment',
+                              owner = self.GPADMIN,
+                              group = self.GPADMIN,
+                              recursive = True
+                              )
+
+    self.assertResourceCalled('Execute', 'chmod 700 /data/hawq/segment',
+                            user = 'root',
+                            timeout = 600
+                            )
+
     self.assertResourceCalled('Directory', '/tmp',
         owner = self.GPADMIN,
         group = self.GPADMIN,
@@ -121,17 +132,6 @@ class TestHawqSegment(RMFTestCase):
 
     self.__asserts_for_configure()
 
-    self.assertResourceCalled('Directory', '/data/hawq/segment',
-        owner = self.GPADMIN,
-        group = self.GPADMIN,
-        recursive = True
-        )
-
-    self.assertResourceCalled('Execute', 'chmod 700 /data/hawq/segment',
-        user = 'root',
-        timeout = 600
-        )
-
     self.assertResourceCalled('Execute', 'source /usr/local/hawq/greenplum_path.sh &&
hawq init segment -a -v',
         logoutput = True, 
         not_if = None, 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c84b99e/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
index c0ec9f9..3e834cf 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
@@ -143,11 +143,7 @@ class TestHawqStandby(RMFTestCase):
 
 
   @patch ('hawqstandby.common.__set_osparams')
-  @patch ('hawqstandby.master_helper.__is_active_master')
-  @patch ('hawqstandby.master_helper.__is_standby_host')
-  def test_start_default(self, standby_host_mock, active_master_mock, set_osparams_mock):
-    standby_host_mock.return_value = True
-    active_master_mock.return_value = False
+  def test_start_default(self, set_osparams_mock):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + '/scripts/hawqstandby.py',
         classname = 'HawqStandby',
@@ -159,28 +155,18 @@ class TestHawqStandby(RMFTestCase):
 
     self.__asserts_for_configure()
 
-    self.assertResourceCalled('Execute', 'source /usr/local/hawq/greenplum_path.sh &&
hawq ssh-exkeys -f /usr/local/hawq/etc/hawq_hosts -p gpadmin',
+    self.assertResourceCalled('Execute', 'source /usr/local/hawq/greenplum_path.sh &&
hawq init standby -a -v',
         logoutput = True,
         not_if = None,
         only_if = None,
         user = self.GPADMIN,
         timeout = 900
         )
-
-    self.assertResourceCalled('Execute', 'source /usr/local/hawq/greenplum_path.sh &&
hawq init standby -a -v',
-        logoutput = True, 
-        not_if = None, 
-        only_if = None, 
-        user = self.GPADMIN,
-        timeout = 900
-        )
     self.assertNoMoreResources()
 
 
   @patch ('hawqstandby.common.__set_osparams')
-  @patch ('hawqstandby.master_helper.__is_active_master')
-  def test_stop_default(self, active_master_mock, set_osparams_mock):
-    active_master_mock.return_value = False
+  def test_stop_default(self, set_osparams_mock):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + '/scripts/hawqstandby.py',
         classname = 'HawqStandby',


Mime
View raw message