Updated Branches: refs/heads/trunk b202f8e67 -> 107df843d
AMBARI-3180. Helper script for HDP upgrade (improve error message). Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/107df843 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/107df843 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/107df843 Branch: refs/heads/trunk Commit: 107df843d945b61bb4d4b208e276fcc2fe02f397 Parents: b202f8e Author: Sumit Mohanty <[email protected]> Authored: Tue Sep 24 18:25:17 2013 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Tue Sep 24 18:28:41 2013 -0700 ---------------------------------------------------------------------- ambari-server/src/main/python/UpgradeHelper_HDP2.py | 11 +++++++---- ambari-server/src/test/python/TestUpgradeScript_HDP2.py | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/107df843/ambari-server/src/main/python/UpgradeHelper_HDP2.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/UpgradeHelper_HDP2.py b/ambari-server/src/main/python/UpgradeHelper_HDP2.py index 6157b43..a3d46bf 100644 --- a/ambari-server/src/main/python/UpgradeHelper_HDP2.py +++ b/ambari-server/src/main/python/UpgradeHelper_HDP2.py @@ -568,7 +568,7 @@ def modify_configs(options, config_type): pass pass pass - update_config_using_existing(options, MAPRED_SITE_TAG, MAPRED_SITE) + update_config_using_existing(options, MAPRED_SITE_TAG, MAPRED_SITE, True) pass # Update global config, hdfs-site, core-site @@ -576,10 +576,10 @@ def modify_configs(options, config_type): update_config_using_existing(options, GLOBAL_TAG, GLOBAL, True) pass if (config_type is None) or (config_type == HDFS_SITE_TAG): - update_config_using_existing(options, HDFS_SITE_TAG, HDFS_SITE) + update_config_using_existing(options, HDFS_SITE_TAG, HDFS_SITE, True) pass if (config_type is None) or (config_type == CORE_SITE_TAG): - update_config_using_existing(options, CORE_SITE_TAG, CORE_SITE) + update_config_using_existing(options, CORE_SITE_TAG, CORE_SITE, True) pass pass @@ -637,7 +637,7 @@ def backup_single_config_type(options, type, error_if_na=True): def install_services(options): SERVICE_URL_FORMAT = URL_FORMAT + '/services?ServiceInfo/state=INIT' - PUT_IN_INSTALLED = """{"ServiceInfo": {"state": "INSTALLED"}}""" + PUT_IN_INSTALLED = """{"RequestInfo":{"context":"Install YARN and MapReduce2"},"Body":{"ServiceInfo": {"state":"INSTALLED"}}}""" response = curl(options.printonly, '-u', AUTH_FORMAT.format(options.user, options.password), @@ -647,6 +647,9 @@ def install_services(options): retcode, errdata = validate_response(response, not options.printonly) if not retcode == 0: raise FatalException(retcode, errdata + "(Services may already be installed.)") + else: + options.exit_message = "A request has been submitted to install Yarn and MapReduce2. Use Ambari Web to monitor " \ + "the status of the install request." pass http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/107df843/ambari-server/src/test/python/TestUpgradeScript_HDP2.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py b/ambari-server/src/test/python/TestUpgradeScript_HDP2.py index e7b9446..fed9b3e 100644 --- a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py +++ b/ambari-server/src/test/python/TestUpgradeScript_HDP2.py @@ -258,7 +258,7 @@ class TestUpgradeHDP2Script(TestCase): UpgradeHelper_HDP2.main() expected_curl_calls = [ call(False, "-u", "admin:admin", "-X", "PUT", "-d", - """{"ServiceInfo": {"state": "INSTALLED"}}""", + """{"RequestInfo":{"context":"Install YARN and MapReduce2"},"Body":{"ServiceInfo": {"state":"INSTALLED"}}}""", "http://localhost:8080/api/v1/clusters/c1/services?ServiceInfo/state=INIT")] curl_mock.assert_has_calls(expected_curl_calls, any_order=True) pass
