You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2016/03/15 03:15:08 UTC

[2/2] ambari git commit: AMBARI-15416. Grafana password is required field after upgrade from 2.2.0 to 2.2.2. (swagle)

AMBARI-15416. Grafana password is required field after upgrade from 2.2.0 to 2.2.2. (swagle)


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

Branch: refs/heads/trunk
Commit: 17bdcaf0954a9636c64fbb98bfce4ccde5fdb5f2
Parents: 122bebf
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Mon Mar 14 19:14:50 2016 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Mon Mar 14 19:14:50 2016 -0700

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py        | 14 ++++++++++++++
 .../python/stacks/2.2/common/test_stack_advisor.py    |  7 +++++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/17bdcaf0/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 9ac912d..0de54bc 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
@@ -493,6 +493,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
     putAmsHbaseSiteProperty = self.putProperty(configurations, "ams-hbase-site", services)
     putAmsSiteProperty = self.putProperty(configurations, "ams-site", services)
     putHbaseEnvProperty = self.putProperty(configurations, "ams-hbase-env", services)
+    putGrafanaPropertyAttribute = self.putPropertyAttribute(configurations, "ams-grafana-env")
 
     amsCollectorHosts = self.getComponentHostNames(services, "AMBARI_METRICS", "METRICS_COLLECTOR")
 
@@ -656,6 +657,19 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
     putAmsSiteProperty("timeline.metrics.host.aggregate.splitpoints", ','.join(precision_splits))
     putAmsSiteProperty("timeline.metrics.cluster.aggregate.splitpoints", ','.join(aggregate_splits))
 
+    component_grafana_exists = False
+    for service in services:
+      if 'components' in service:
+        for component in service['components']:
+          if 'StackServiceComponents' in component:
+            if 'METRICS_GRAFANA' in component['StackServiceComponents']['component_name']:
+              component_grafana_exists = True
+              break
+    pass
+
+    if not component_grafana_exists:
+      putGrafanaPropertyAttribute("metrics_grafana_password", "visible", "false")
+
     pass
 
   def getHostNamesWithComponent(self, serviceName, componentName, services):

http://git-wip-us.apache.org/repos/asf/ambari/blob/17bdcaf0/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index 162bf45..6f6e6d8 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -2038,6 +2038,13 @@ class TestHDP22StackAdvisor(TestCase):
           "hbase_regionserver_heapsize": "768"
         }
       },
+      "ams-grafana-env": {
+        "property_attributes": {
+          "metrics_grafana_password": {
+            "visible": "false"
+          }
+        }
+      },
       "ams-env": {
         "properties": {
           "metrics_collector_heapsize": "512",