ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject [1/2] ambari git commit: AMBARI-15416. Grafana password is required field after upgrade from 2.2.0 to 2.2.2. (swagle)
Date Tue, 15 Mar 2016 02:13:01 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 a38e3a96e -> ac740437b


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/ac740437
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ac740437
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ac740437

Branch: refs/heads/branch-2.2
Commit: ac740437b162d742430c986d7fe2350684144f58
Parents: 66b3eb2
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Mon Mar 14 19:12:26 2016 -0700
Committer: Siddharth Wagle <swagle@hortonworks.com>
Committed: Mon Mar 14 19:12:33 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/ac740437/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 9acad1d..f15263e 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
@@ -470,6 +470,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")
 
@@ -633,6 +634,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/ac740437/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 6a8a6c8..f09198f 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
@@ -1999,6 +1999,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",


Mime
View raw message