This is an automated email from the ASF dual-hosted git repository. mpapirkovskyy pushed a commit to branch branch-2.7 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push: new 7c02075 AMBARI-24484. HDP-GPL repo's shouldn't be pushed to hosts when GPL license was not applied. (#2083) 7c02075 is described below commit 7c02075b3b18edfefa4f5a3d4ab1cd7f08edf766 Author: Myroslav Papirkovskyi <mpapirkovs...@apache.org> AuthorDate: Thu Aug 16 11:59:22 2018 +0300 AMBARI-24484. HDP-GPL repo's shouldn't be pushed to hosts when GPL license was not applied. (#2083) * AMBARI-24484. HDP-GPL repo's shouldn't be pushed to hosts when GPL license was not applied. (mpapirkovskyy) * AMBARI-24484. HDP-GPL repo's shouldn't be pushed to hosts when GPL license was not applied. (mpapirkovskyy) --- .../main/python/resource_management/libraries/script/script.py | 9 +++++++++ .../java/org/apache/ambari/server/agent/CommandRepository.java | 1 + 2 files changed, 10 insertions(+) diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py index 52287a4..e630f6e 100644 --- a/ambari-common/src/main/python/resource_management/libraries/script/script.py +++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py @@ -781,6 +781,15 @@ class Script(object): service_name = config['serviceName'] if 'serviceName' in config else None repos = CommandRepository(config['repositoryFile']) + + from resource_management.libraries.functions import lzo_utils + + # remove repos with 'GPL' tag when GPL license is not approved + repo_tags_to_skip = set() + if not lzo_utils.is_gpl_license_accepted(): + repo_tags_to_skip.add("GPL") + repos.items = [r for r in repos.items if not (repo_tags_to_skip & r.tags)] + repo_ids = [repo.repo_id for repo in repos.items] Logger.info("Command repositories: {0}".format(", ".join(repo_ids))) repos.items = [x for x in repos.items if (not x.applicable_services or service_name in x.applicable_services) ] diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java index 00c837a..2671241 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java @@ -272,6 +272,7 @@ public class CommandRepository { private List<String> m_applicableServices; @SerializedName("tags") + @JsonProperty("tags") private Set<RepoTag> m_tags;