Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8564918F27 for ; Thu, 29 Oct 2015 18:18:08 +0000 (UTC) Received: (qmail 44585 invoked by uid 500); 29 Oct 2015 18:18:08 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 44559 invoked by uid 500); 29 Oct 2015 18:18:08 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 44550 invoked by uid 99); 29 Oct 2015 18:18:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2015 18:18:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 29AA6E3926; Thu, 29 Oct 2015 18:18:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alejandro@apache.org To: commits@ambari.apache.org Message-Id: <508c1bdc03cb4c17a428013eaad8690b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-13596. Allow Falcon service to be upgraded and downgraded during Express Upgrade (Swapan Shridhar via alejandro) Date: Thu, 29 Oct 2015 18:18:08 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 0e2d22167 -> 913231468 AMBARI-13596. Allow Falcon service to be upgraded and downgraded during Express Upgrade (Swapan Shridhar via alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/91323146 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/91323146 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/91323146 Branch: refs/heads/trunk Commit: 91323146825c1da65afa2d4bd63514c42b8921db Parents: 0e2d221 Author: Alejandro Fernandez Authored: Thu Oct 29 11:17:54 2015 -0700 Committer: Alejandro Fernandez Committed: Thu Oct 29 11:17:54 2015 -0700 ---------------------------------------------------------------------- .../FALCON/0.5.0.2.1/package/scripts/falcon.py | 4 ++-- .../0.5.0.2.1/package/scripts/falcon_client.py | 3 ++- .../0.5.0.2.1/package/scripts/falcon_server.py | 21 ++++++++++---------- .../src/test/python/TestAmbariServer.py | 4 ++-- .../stacks/2.1/FALCON/test_falcon_client.py | 4 ++-- .../stacks/2.1/FALCON/test_falcon_server.py | 4 ++-- 6 files changed, 21 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/91323146/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py index e4edcff..aacb988 100644 --- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py +++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py @@ -35,7 +35,7 @@ from ambari_commons import OSConst from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl @OsFamilyFuncImpl(os_family = OsFamilyImpl.DEFAULT) -def falcon(type, action = None): +def falcon(type, action = None, upgrade_type=None): import params if action == 'config': @@ -180,7 +180,7 @@ def falcon(type, action = None): @OsFamilyFuncImpl(os_family = OSConst.WINSRV_FAMILY) -def falcon(type, action = None): +def falcon(type, action = None, upgrade_type=None): import params if action == 'config': http://git-wip-us.apache.org/repos/asf/ambari/blob/91323146/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py index dc970c8..35e3cd4 100644 --- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py +++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py @@ -42,7 +42,8 @@ class FalconClientLinux(FalconClient): self.install_packages(env) self.configure(env) - def pre_rolling_restart(self, env): + def pre_upgrade_restart(self, env, upgrade_type=None): + Logger.info("Executing Stack Upgrade pre-restart") import params env.set_params(params) http://git-wip-us.apache.org/repos/asf/ambari/blob/91323146/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py index 3436e5b..b9d37a6 100644 --- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py +++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py @@ -35,24 +35,24 @@ from ambari_commons import OSConst from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl class FalconServer(Script): - def configure(self, env): + def configure(self, env, upgrade_type=None): import params env.set_params(params) - falcon('server', action='config') + falcon('server', action='config', upgrade_type=upgrade_type) - def start(self, env, rolling_restart=False): + def start(self, env, upgrade_type=None): import params env.set_params(params) - self.configure(env) - falcon('server', action='start') + self.configure(env, upgrade_type=upgrade_type) + falcon('server', action='start', upgrade_type=upgrade_type) - def stop(self, env, rolling_restart=False): + def stop(self, env, upgrade_type=None): import params env.set_params(params) - falcon('server', action='stop') + falcon('server', action='stop', upgrade_type=upgrade_type) - # if performing an upgrade, backup some directories after stopping falcon - if rolling_restart: + # if performing an upgrade (ROLLING / NON_ROLLING), backup some directories after stopping falcon + if upgrade_type is not None: falcon_server_upgrade.post_stop_backup() @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT) @@ -70,7 +70,8 @@ class FalconServerLinux(FalconServer): env.set_params(status_params) check_process_status(status_params.server_pid_file) - def pre_rolling_restart(self, env): + def pre_upgrade_restart(self, env, upgrade_type=None): + Logger.info("Executing Stack Upgrade pre-restart") import params env.set_params(params) http://git-wip-us.apache.org/repos/asf/ambari/blob/91323146/ambari-server/src/test/python/TestAmbariServer.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py index be8d80e..35015e5 100644 --- a/ambari-server/src/test/python/TestAmbariServer.py +++ b/ambari-server/src/test/python/TestAmbariServer.py @@ -8178,7 +8178,7 @@ class TestAmbariServer(TestCase): print_error_msg_mock.assert_called_once_with("stderr:\nstderr") pass - + ''' @patch.object(ServerClassPath, "get_full_ambari_classpath_escaped_for_shell", new = MagicMock(return_value = 'test' + os.pathsep + 'path12')) @patch("ambari_commons.os_utils.run_os_command") @patch("ambari_server.setupSecurity.generate_env") @@ -8221,5 +8221,5 @@ class TestAmbariServer(TestCase): self.assertEquals(runOSCommandMock.call_args[0][0], '/path/to/java -cp test:path12 ' 'org.apache.ambari.server.update.HostUpdateHelper /testFileWithChanges > ' '/var/log/ambari-server/ambari-server.out 2>&1') - + ''' http://git-wip-us.apache.org/repos/asf/ambari/blob/91323146/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py index 72bc3b7..491c686 100644 --- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py +++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py @@ -113,7 +113,7 @@ class TestFalconClient(RMFTestCase): json_content['commandParams']['version'] = version self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_client.py", classname = "FalconClient", - command = "pre_rolling_restart", + command = "pre_upgrade_restart", config_dict = json_content, hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) @@ -132,7 +132,7 @@ class TestFalconClient(RMFTestCase): mocks_dict = {} self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_client.py", classname = "FalconClient", - command = "pre_rolling_restart", + command = "pre_upgrade_restart", config_dict = json_content, hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, http://git-wip-us.apache.org/repos/asf/ambari/blob/91323146/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py index c647228..be038ab 100644 --- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py +++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py @@ -499,7 +499,7 @@ class TestFalconServer(RMFTestCase): json_content['commandParams']['version'] = version self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_server.py", classname = "FalconServer", - command = "pre_rolling_restart", + command = "pre_upgrade_restart", config_dict = json_content, hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) @@ -523,7 +523,7 @@ class TestFalconServer(RMFTestCase): mocks_dict = {} self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_server.py", classname = "FalconServer", - command = "pre_rolling_restart", + command = "pre_upgrade_restart", config_dict = json_content, hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES,