ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-14068. Ambari StackAdvisor should use the same default setting for the core-site proxyuser.groups configuration property.(vbrodetskyi)
Date Wed, 25 Nov 2015 18:04:54 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 82c93425d -> 9a05c0591


AMBARI-14068. Ambari StackAdvisor should use the same default setting for the core-site proxyuser.groups
configuration property.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 9a05c0591255e1e69a4b1478f089be5fe2a2e42c
Parents: 82c9342
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Wed Nov 25 17:03:27 2015 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Wed Nov 25 17:03:27 2015 +0200

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |  14 +-
 .../stacks/2.0.6/common/test_stack_advisor.py   | 139 +++++++++----------
 2 files changed, 70 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9a05c059/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 5a4b32f..6031fbd 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
@@ -186,26 +186,20 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
               and "webhcat_user" in services["configurations"]["hive-env"]["properties"]:
         hive_user = services["configurations"]["hive-env"]["properties"]["hive_user"]
         webhcat_user = services["configurations"]["hive-env"]["properties"]["webhcat_user"]
-        proxy_user_group = None
-        if "hadoop-env" in services["configurations"] and "proxyuser_group" in services["configurations"]["hadoop-env"]["properties"]:
-          proxy_user_group = services["configurations"]["hadoop-env"]["properties"]["proxyuser_group"]
         hiveServerrHost = self.getHostWithComponent("HIVE", "HIVE_SERVER", services, hosts)
         if hiveServerrHost is not None:
           hiveServerHostName = hiveServerrHost["Hosts"]["public_host_name"]
           if not hive_user in users and hive_user is not None:
             users[hive_user] = {"propertyHosts" : hiveServerHostName,"propertyGroups" : "*",
"config" : "hive-env", "propertyName" : "hive_user"}
-          if not webhcat_user in users and not None in [webhcat_user , proxy_user_group]:
-            users[webhcat_user] = {"propertyHosts" : hiveServerHostName,"propertyGroups"
: proxy_user_group, "config" : "hive-env", "propertyName" : "webhcat_user"}
+          if not webhcat_user in users and webhcat_user is not None:
+            users[webhcat_user] = {"propertyHosts" : hiveServerHostName,"propertyGroups"
: "*", "config" : "hive-env", "propertyName" : "webhcat_user"}
 
     if "FALCON" in servicesList:
       falconUser = None
       if "falcon-env" in services["configurations"] and "falcon_user" in services["configurations"]["falcon-env"]["properties"]:
         falconUser = services["configurations"]["falcon-env"]["properties"]["falcon_user"]
-        proxy_user_group = None
-        if "hadoop-env" in services["configurations"] and "proxyuser_group" in services["configurations"]["hadoop-env"]["properties"]:
-          proxy_user_group = services["configurations"]["hadoop-env"]["properties"]["proxyuser_group"]
-        if not falconUser in users and not None in [proxy_user_group, falconUser]:
-          users[falconUser] = {"propertyHosts" : "*","propertyGroups" : proxy_user_group,
"config" : "falcon-env", "propertyName" : "falcon_user"}
+        if not falconUser in users and falconUser is not None:
+          users[falconUser] = {"propertyHosts" : "*","propertyGroups" : "*", "config" : "falcon-env",
"propertyName" : "falcon_user"}
 
     putCoreSiteProperty = self.putProperty(configurations, "core-site", services)
     putCoreSitePropertyAttribute = self.putPropertyAttribute(configurations, "core-site")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9a05c059/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 456977c..439a769 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
@@ -1023,51 +1023,37 @@ class TestHDP206StackAdvisor(TestCase):
     clusterData = {
       "totalAvailableRam": 2048
     }
-    expected = {
-      'hadoop-env': {
-        'properties': {
-          'namenode_heapsize': '1024',
-          'namenode_opt_newsize': '256',
-          'namenode_opt_maxnewsize': '256',
-          'hdfs_user': 'hdfs',
-          "proxyuser_group": "users"
-        }
-      },
-      "core-site": {
-        "properties": {
-          "hadoop.proxyuser.hdfs.hosts": "*",
-          "hadoop.proxyuser.hdfs.groups": "*",
-          "hadoop.proxyuser.hive.hosts": "c6401.ambari.apache.org",
-          "hadoop.proxyuser.hive.groups": "*",
-          "hadoop.proxyuser.webhcat.hosts": "c6401.ambari.apache.org",
-          "hadoop.proxyuser.webhcat.groups": "users",
-          "hadoop.proxyuser.oozie.groups": "*",
-          "hadoop.proxyuser.oozie.hosts": "c6401.ambari.apache.org",
-          "hadoop.proxyuser.falcon.groups": "users",
-          "hadoop.proxyuser.falcon.hosts": "*"
-        }
-      },
-      "hive-env": {
-        "properties": {
-          "hive_user": "hive",
-          "webhcat_user": "webhcat"
-        }
-      },
-      "hdfs-site": {
-        "properties": {
-        }
-      },
-      "oozie-env": {
-        "properties": {
-          "oozie_user": "oozie"
-        }
-      },
-      "falcon-env": {
-        "properties": {
-          "falcon_user": "falcon"
-        }
-      }
-    }
+    expected = {'oozie-env':
+                  {'properties':
+                     {'oozie_user': 'oozie'}},
+                'core-site':
+                  {'properties':
+                     {'hadoop.proxyuser.oozie.groups': '*',
+                      'hadoop.proxyuser.hive.groups': '*',
+                      'hadoop.proxyuser.webhcat.hosts': 'c6401.ambari.apache.org',
+                      'hadoop.proxyuser.falcon.hosts': '*',
+                      'hadoop.proxyuser.webhcat.groups': '*',
+                      'hadoop.proxyuser.hdfs.groups': '*',
+                      'hadoop.proxyuser.hdfs.hosts': '*',
+                      'hadoop.proxyuser.hive.hosts': 'c6401.ambari.apache.org',
+                      'hadoop.proxyuser.oozie.hosts': 'c6401.ambari.apache.org',
+                      'hadoop.proxyuser.falcon.groups': '*'}},
+                'falcon-env':
+                  {'properties':
+                     {'falcon_user': 'falcon'}},
+                'hive-env':
+                  {'properties':
+                     {'hive_user': 'hive',
+                      'webhcat_user': 'webhcat'}},
+                'hdfs-site':
+                  {'properties': {}},
+                'hadoop-env':
+                  {'properties':
+                     {'hdfs_user': 'hdfs',
+                      'namenode_heapsize': '1024',
+                      'proxyuser_group': 'users',
+                      'namenode_opt_maxnewsize': '256',
+                      'namenode_opt_newsize': '256'}}}
 
     self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, services,
hosts)
     self.assertEquals(configurations, expected)
@@ -1081,34 +1067,41 @@ class TestHDP206StackAdvisor(TestCase):
     services["changed-configurations"] = changedConfigurations
     services['configurations'] = configurations
 
-    core_site = {
-      "properties": {
-        "hadoop.proxyuser.hdfs1.hosts": "*",
-        "hadoop.proxyuser.hdfs1.groups": "*",
-        "hadoop.proxyuser.hdfs.hosts": "*",
-        "hadoop.proxyuser.hdfs.groups": "*",
-        "hadoop.proxyuser.hive.hosts": "c6401.ambari.apache.org",
-        "hadoop.proxyuser.hive.groups": "*",
-        "hadoop.proxyuser.webhcat.hosts": "c6401.ambari.apache.org",
-        "hadoop.proxyuser.webhcat.groups": "users",
-        "hadoop.proxyuser.oozie.groups": "*",
-        "hadoop.proxyuser.oozie.hosts": "c6401.ambari.apache.org",
-        "hadoop.proxyuser.falcon.groups": "users",
-        "hadoop.proxyuser.falcon.hosts": "*"
-      },
-      "property_attributes": {
-        "hadoop.proxyuser.hdfs.hosts": {
-          "delete": "true"
-        },
-        "hadoop.proxyuser.hdfs.groups": {
-          "delete": "true"
-        }
-      }
-
-    }
-
-    expected["core-site"] = core_site
-    expected["hadoop-env"]["properties"]["hdfs_user"] = "hdfs1"
+    expected = {'oozie-env':
+                  {'properties':
+                     {'oozie_user': 'oozie'}},
+                'core-site': {'properties':
+                                {'hadoop.proxyuser.oozie.groups': '*',
+                                 'hadoop.proxyuser.hive.groups': '*',
+                                 'hadoop.proxyuser.hdfs1.groups': '*',
+                                 'hadoop.proxyuser.hdfs1.hosts': '*',
+                                 'hadoop.proxyuser.webhcat.hosts': 'c6401.ambari.apache.org',
+                                 'hadoop.proxyuser.falcon.hosts': '*',
+                                 'hadoop.proxyuser.webhcat.groups': '*',
+                                 'hadoop.proxyuser.hdfs.groups': '*',
+                                 'hadoop.proxyuser.hdfs.hosts': '*',
+                                 'hadoop.proxyuser.hive.hosts': 'c6401.ambari.apache.org',
+                                 'hadoop.proxyuser.oozie.hosts': 'c6401.ambari.apache.org',
+                                 'hadoop.proxyuser.falcon.groups': '*'},
+                              'property_attributes':
+                                {'hadoop.proxyuser.hdfs.groups': {'delete': 'true'},
+                                 'hadoop.proxyuser.hdfs.hosts': {'delete': 'true'}}},
+                'falcon-env':
+                  {'properties':
+                     {'falcon_user': 'falcon'}},
+                'hive-env':
+                  {'properties':
+                     {'hive_user': 'hive',
+                      'webhcat_user': 'webhcat'}},
+                'hdfs-site':
+                  {'properties': {}},
+                'hadoop-env':
+                  {'properties':
+                     {'hdfs_user': 'hdfs1',
+                      'namenode_heapsize': '1024',
+                      'proxyuser_group': 'users',
+                      'namenode_opt_maxnewsize': '256',
+                      'namenode_opt_newsize': '256'}}}
 
     self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, services,
hosts)
     self.assertEquals(configurations, expected)


Mime
View raw message