Repository: ambari
Updated Branches:
  refs/heads/trunk 4240f8496 -> 1a803ccab


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/1a803cca
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1a803cca
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1a803cca

Branch: refs/heads/trunk
Commit: 1a803ccab0eeaa9bd6cf45d1be1139b7a240df1e
Parents: 4240f84
Author: Siddharth Wagle <swa...@hortonworks.com>
Authored: Thu Nov 30 09:47:46 2017 -0800
Committer: Siddharth Wagle <swa...@hortonworks.com>
Committed: Thu Nov 30 09:47:46 2017 -0800

----------------------------------------------------------------------
 .../python/ambari_server/serverConfiguration.py    | 17 ++++++-----------
 .../src/main/python/ambari_server/serverUpgrade.py | 14 +++++++++-----
 .../stacks/HDP/2.0.6/services/stack_advisor.py     |  2 +-
 .../stacks/2.0.6/common/test_stack_advisor.py      |  4 ++--
 4 files changed, 18 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1a803cca/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 f744fa0..d6ab453 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -196,14 +196,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"
 
@@ -1151,8 +1145,9 @@ def update_ambari_env():
     return -1
 
   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"
@@ -1162,7 +1157,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/1a803cca/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 57a1ae0..c2b7de8 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/1a803cca/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 5584377..7e9ed44 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
@@ -382,7 +382,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/1a803cca/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 300ffe9..f862fc6 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
@@ -2558,14 +2558,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',

Reply via email to