ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject ambari git commit: AMBARI-12797: [PluggableStackDefinition] Add ability to filter list of operating systems from repoinfo (jluniya)
Date Tue, 18 Aug 2015 06:43:37 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 85d87e55d -> 6c46c0f00


AMBARI-12797: [PluggableStackDefinition] Add ability to filter list of operating systems from
repoinfo (jluniya)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6c46c0f0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6c46c0f0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6c46c0f0

Branch: refs/heads/branch-2.1
Commit: 6c46c0f00122555a72c4812da76dd3e0fac22fa1
Parents: 85d87e5
Author: Jayush Luniya <jluniya@hortonworks.com>
Authored: Mon Aug 17 23:42:29 2015 -0700
Committer: Jayush Luniya <jluniya@hortonworks.com>
Committed: Mon Aug 17 23:43:32 2015 -0700

----------------------------------------------------------------------
 .../pluggable_stack_definition/GenerateStackDefinition.py   | 9 +++++++++
 .../main/python/pluggable_stack_definition/configs/PHD.json | 4 ++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c46c0f0/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
b/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
index 6e0e255..92d5b70 100644
--- a/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
+++ b/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
@@ -335,6 +335,15 @@ def process_repoinfo_xml(file_path, config_data, stack_version_changes,
stack):
     #########################################################################################
     tree = ET.parse(file_path)
     root = tree.getroot()
+    remove_list = list()
+    if 'family' in stack:
+      for os_tag in root.iter("os"):
+        os_family = os_tag.get('family')
+        if os_family not in stack.family:
+          remove_list.append(os_tag)
+    for os_tag in remove_list:
+      root.remove(os_tag)
+
     # Update all base urls
     for baseurl_tag in root.getiterator('baseurl'):
       baseurl_tag.text = 'http://SET_REPO_URL'

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c46c0f0/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json b/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json
index ca6f49c..f3beb6e 100644
--- a/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json
+++ b/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json
@@ -25,6 +25,7 @@
     {
       "version": "2.0.6",
       "baseVersion": "2.0.6",
+      "family": "redhat6,suse11",
       "active": "false",
       "services": [
         {
@@ -64,6 +65,7 @@
       "version": "2.1",
       "baseVersion": "2.1",
       "active": "false",
+      "family": "redhat6,suse11",
       "services": [
         {
           "name": "HDFS"
@@ -101,6 +103,7 @@
       "version": "3.0",
       "baseVersion": "2.2",
       "active": "true",
+      "family": "redhat6,suse11",
       "services": [
         {
           "name": "HDFS"
@@ -169,6 +172,7 @@
       "version": "3.3",
       "baseVersion": "2.3",
       "active": "true",
+      "family": "redhat6,redhat7,suse11",
       "services": [
         {
           "name": "HDFS"


Mime
View raw message