You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2018/09/16 06:38:06 UTC
[ambari] branch branch-2.6 updated: AMBARI-24622. Allow skipping
package operations for LZO on sysprepped hosts (#2303)
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new f148c17 AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts (#2303)
f148c17 is described below
commit f148c17b4ac745335d3047ca1953f2a67815d1ab
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Sun Sep 16 08:38:01 2018 +0200
AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts (#2303)
---
.../resource_management/libraries/functions/lzo_utils.py | 11 +++++++++++
.../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml | 11 +++++++++++
2 files changed, 22 insertions(+)
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
index e125e4e..c0ca05e 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
@@ -82,6 +82,13 @@ def should_install_lzo():
return True
+def skip_package_operations():
+ """
+ Return true if LZO packages are assumed to be pre-installed
+ Needs to be separate from should_install_lzo, as that one is used during tarball creation, too
+ """
+ return default("/hostLevelParams/host_sys_prepped", False) and default("/configurations/cluster-env/sysprep_skip_lzo_package_operations", False)
+
def install_lzo_if_needed():
"""
Install lzo package if {#should_install_lzo} is true
@@ -89,6 +96,10 @@ def install_lzo_if_needed():
if not should_install_lzo():
return
+ if skip_package_operations():
+ Logger.info("Skipping LZO package installation as host is sys prepped")
+ return
+
# If user has just accepted GPL license. GPL repository can not yet be present.
Script.repository_util.create_repo_files()
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 591b9f5..773db68 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -148,6 +148,17 @@
<on-ambari-upgrade add="true"/>
</property>
<property>
+ <name>sysprep_skip_lzo_package_operations</name>
+ <display-name>Whether LZO packages are also pre-installed on sysprepped cluster</display-name>
+ <value>false</value>
+ <description>In sysprepped environments true value indicates that LZO packages are pre-installed and should not be managed by Ambari</description>
+ <value-attributes>
+ <overridable>true</overridable>
+ <type>boolean</type>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
<name>sysprep_skip_setup_jce</name>
<display-name>Whether to skip setting up the unlimited key JCE policy on sysprepped cluster</display-name>
<value>false</value>