Repository: ambari Updated Branches: refs/heads/branch-2.6 70418a031 -> 51bd023a2
AMBARI-22555. Update server setup to deny GPL as default. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/51bd023a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/51bd023a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/51bd023a Branch: refs/heads/branch-2.6 Commit: 51bd023a2e3cfeafebe6a0e65820f82c0dd0cbd5 Parents: 70418a0 Author: Siddharth Wagle <swa...@hortonworks.com> Authored: Thu Nov 30 09:43:09 2017 -0800 Committer: Siddharth Wagle <swa...@hortonworks.com> Committed: Thu Nov 30 09:43:20 2017 -0800 ---------------------------------------------------------------------- .../main/python/ambari_server/serverConfiguration.py | 15 +++++---------- .../src/main/python/ambari_server/serverUpgrade.py | 14 +++++++++----- .../stacks/HDP/2.0.6/services/stack_advisor.py | 2 +- .../python/stacks/2.0.6/common/test_stack_advisor.py | 4 ++-- 4 files changed, 17 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/51bd023a/ambari-server/src/main/python/ambari_server/serverConfiguration.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py index 8697e4c..2ab2484 100644 --- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py +++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py @@ -190,14 +190,8 @@ SETUP_OR_UPGRADE_MSG = "- If this is a new setup, then run the \"ambari-server s "- If this is an upgrade of an existing setup, run the \"ambari-server upgrade\" command.\n" \ "Refer to the Ambari documentation for more information on setup and upgrade." -GPL_LICENSE_PROMPT_TEXT = """To download GPL licensed products like lzo you must accept the license terms below: -LICENSE_LINE_1 -LICENSE_LINE_2 -LICENSE_LINE_3 -LICENSE_LINE_4 -LICENSE_LINE_5 -LICENSE_LINE_6 -Do you accept the GPL License Agreement [y/n] (y)?""" +GPL_LICENSE_PROMPT_TEXT = """GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html +Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? """ DEFAULT_DB_NAME = "ambari" @@ -1149,7 +1143,8 @@ def update_ambari_env(): return 0 -def write_gpl_license_accepted(): +# default should be false / not accepted +def write_gpl_license_accepted(text = GPL_LICENSE_PROMPT_TEXT): properties = get_ambari_properties() if properties == -1: err = "Error getting ambari properties" @@ -1159,7 +1154,7 @@ def write_gpl_license_accepted(): if GPL_LICENSE_ACCEPTED_PROPERTY in properties.keys() and properties.get_property(GPL_LICENSE_ACCEPTED_PROPERTY).lower() == "true": return True - result = get_YN_input(GPL_LICENSE_PROMPT_TEXT, True) + result = get_YN_input(text, False) properties.process_pair(GPL_LICENSE_ACCEPTED_PROPERTY, str(result).lower()) update_properties(properties) http://git-wip-us.apache.org/repos/asf/ambari/blob/51bd023a/ambari-server/src/main/python/ambari_server/serverUpgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverUpgrade.py b/ambari-server/src/main/python/ambari_server/serverUpgrade.py index a864609..06443d3 100644 --- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py +++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py @@ -74,10 +74,14 @@ SCHEMA_UPGRADE_DEBUG = False SUSPEND_START_MODE = False -INSALLED_LZO_WITHOUT_GPL_TEXT = "By saying no, Ambari will not automatically install LZO on any new host in the cluster." + \ -"It is up to you to ensure LZO is installed and configured appropriately." + \ -"Without LZO being installed and configured data compressed with LZO will not be readable. " + \ -"Are you sure you want to proceed? [y/n] (n)?" +INSTALLED_LZO_WITHOUT_GPL_TEXT = "By saying no, Ambari will not automatically install LZO on any new host in the cluster. " \ + "It is up to you to ensure LZO is installed and configured appropriately. " \ + "Without LZO being installed and configured, data compressed with LZO will not be readable. " \ + "Are you sure you want to proceed? [y/n] (n)? " + +LZO_ENABLED_GPL_TEXT = "GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html\n" \ + "Your cluster is configured to use LZO which is GPL software. " \ + "You must agree to enable Ambari to continue downloading and installing LZO [y/n] (n)? " def load_stack_values(version, filename): import xml.etree.ElementTree as ET @@ -175,7 +179,7 @@ def check_gpl_license_approved(upgrade_response): if 'lzo_enabled' not in upgrade_response or upgrade_response['lzo_enabled'].lower() != "true": return - while not write_gpl_license_accepted() and not get_YN_input(INSALLED_LZO_WITHOUT_GPL_TEXT, False): + while not write_gpl_license_accepted(LZO_ENABLED_GPL_TEXT) and not get_YN_input(INSTALLED_LZO_WITHOUT_GPL_TEXT, False): pass # http://git-wip-us.apache.org/repos/asf/ambari/blob/51bd023a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py index 3f8a772..a8a4ae9 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py @@ -547,7 +547,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor): if not lzo_allowed and lzo_codec_class in property_value: validations.append({"config-name": property_name, "item": self.getNotApplicableItem( "Your Ambari Server has not been configured to download LZO and install it. " - "LZO is GPL software and requires you to accept a license prior to use. " + "LZO is GPL software and requires you to explicitly enable Ambari to install and download LZO. " "Please refer to the documentation to configure Ambari before proceeding.")}) def recommendHbaseConfigurations(self, configurations, clusterData, services, hosts): http://git-wip-us.apache.org/repos/asf/ambari/blob/51bd023a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py index e5adb19..cdef5e1 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py @@ -2373,14 +2373,14 @@ class TestHDP206StackAdvisor(TestCase): services["gpl-license-accepted"] = False res_expected = [{'config-type': 'core-site', 'message': 'Your Ambari Server has not been configured to download LZO and install it. ' - 'LZO is GPL software and requires you to accept a license prior to use. ' + 'LZO is GPL software and requires you to explicitly enable Ambari to install and download LZO. ' 'Please refer to the documentation to configure Ambari before proceeding.', 'type': 'configuration', 'config-name': 'io.compression.codecs', 'level': 'NOT_APPLICABLE'}, {'config-type': 'core-site', 'message': 'Your Ambari Server has not been configured to download LZO and install it. ' - 'LZO is GPL software and requires you to accept a license prior to use. ' + 'LZO is GPL software and requires you to explicitly enable Ambari to install and download LZO. ' 'Please refer to the documentation to configure Ambari before proceeding.', 'type': 'configuration', 'config-name': 'io.compression.codec.lzo.class',