ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-8988 cluster-env properties shouldn't be hardcoded in site_properties.js. (atkach)
Date Tue, 06 Jan 2015 11:02:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk aba38ba2d -> 1dbf72ef4


AMBARI-8988 cluster-env properties shouldn't be hardcoded in site_properties.js. (atkach)


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

Branch: refs/heads/trunk
Commit: 1dbf72ef47a387cf19df2f85bf2abbd0311e9e0a
Parents: aba38ba
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Tue Jan 6 12:42:21 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Tue Jan 6 12:42:21 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/data/BIGTOP/site_properties.js |  68 --------
 ambari-web/app/data/HDP2/site_properties.js   | 194 +--------------------
 ambari-web/app/data/PHD/site_properties.js    |  69 --------
 ambari-web/app/utils/config.js                |   6 +-
 ambari-web/test/utils/config_test.js          |  37 +++-
 5 files changed, 44 insertions(+), 330 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1dbf72ef/ambari-web/app/data/BIGTOP/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/BIGTOP/site_properties.js b/ambari-web/app/data/BIGTOP/site_properties.js
index 29244ce..04d9f99 100644
--- a/ambari-web/app/data/BIGTOP/site_properties.js
+++ b/ambari-web/app/data/BIGTOP/site_properties.js
@@ -1929,44 +1929,6 @@ module.exports =
       "filename": "hadoop-env.xml",
       "category": "Advanced hadoop-env"
     },
-    {
-      "id": "puppet var",
-      "name": "security_enabled",
-      "displayName": "Hadoop Security",
-      "description": "Enable hadoop security",
-      "defaultValue": 'false',
-      "isRequired": false,
-      "displayType": "checkbox",
-      "isOverridable": false,
-      "isVisible": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "kerberos_domain",
-      "displayName": "Kerberos realm",
-      "description": "Kerberos realm",
-      "defaultValue": 'EXAMPLE.COM',
-      "isRequired": false,
-      "isOverridable": false,
-      "isVisible": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "rpm_version",
-      "displayName": "Hadoop RPM version",
-      "description": "Hadoop RPM version",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
 
   /**********************************************MAPREDUCE2***************************************/
     {
@@ -3782,20 +3744,6 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "smokeuser",
-      "displayName": "Smoke Test User",
-      "description": "The user used to run service smoke tests",
-      "defaultValue": "ambari-qa",
-      "isReconfigurable": false,
-      "displayType": "user",
-      "isOverridable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml",
-      "category": "Users and Groups",
-      "index": 16
-    },
-    {
-      "id": "puppet var",
       "name": "tez_user",
       "displayName": "Tez User",
       "description": "User to run Tez as",
@@ -3812,21 +3760,6 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "user_group",
-      "displayName": "Hadoop Group",
-      "description": "Group that the users specified above belong to",
-      "defaultValue": "hadoop",
-      "isReconfigurable": false,
-      "displayType": "user",
-      "isOverridable": false,
-      "isVisible": true,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml",
-      "category": "Users and Groups",
-      "index": 17
-    },
-    {
-      "id": "puppet var",
       "name": "sqoop_user",
       "displayName": "Sqoop User",
       "isReconfigurable": false,
@@ -3862,7 +3795,6 @@ module.exports =
       "isReconfigurable": true,
       "isOverridable": false,
       "isVisible": true,
-      "serviceName": "MISC",
       "filename": "cluster-env.xml",
       "category": "Users and Groups"
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1dbf72ef/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 396cf20..1f80d58 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -56,7 +56,6 @@ module.exports =
       "displayType": "user",
       "isOverridable": false,
       "isVisible": App.get('isHadoopWindowsStack'),
-      "serviceName": "MISC",
       "filename": "cluster-env.xml",
       "category": "Users and Groups",
       "belongsToService": ["HDFS"],
@@ -71,7 +70,6 @@ module.exports =
       "displayType": "password",
       "isOverridable": false,
       "isVisible": App.get('isHadoopWindowsStack'),
-      "serviceName": "MISC",
       "filename": "cluster-env.xml",
       "category": "Users and Groups",
       "belongsToService": ["HDFS"],
@@ -101,7 +99,6 @@ module.exports =
       "description": "Using an existing MSSQL database for Metrics Sink",
       "displayType": "masterHost",
       "isOverridable": false,
-      "isVisible": false,
       "isReconfigurable": false,
       "serviceName": "HDFS",
       "category": "MetricsSink",
@@ -117,7 +114,6 @@ module.exports =
       "description": "Using an existing MSSQL database for Metrics Sink",
       "displayType": "masterHost",
       "isOverridable": false,
-      "isVisible": false,
       "isReconfigurable": false,
       "serviceName": "HDFS",
       "category": "MetricsSink",
@@ -160,7 +156,6 @@ module.exports =
       "displayType": "host",
       "isOverridable": false,
       "isObserved": true,
-      "isVisible": false,
       "category": "MetricsSink",
       "serviceName": "HDFS",
       "index": 2,
@@ -175,7 +170,6 @@ module.exports =
       "displayType": "host",
       "isOverridable": false,
       "isRequiredByAgent": false,
-      "isVisible": false,
       "isObserved": true,
       "serviceName": "HDFS",
       "category": "MetricsSink",
@@ -191,7 +185,6 @@ module.exports =
       "displayType": "host",
       "isOverridable": false,
       "isRequiredByAgent": false,
-      "isVisible": false,
       "isObserved": true,
       "serviceName": "HDFS",
       "category": "MetricsSink",
@@ -205,6 +198,7 @@ module.exports =
       "isOverridable": false,
       "displayType": "host",
       "isObserved": true,
+      "isVisible": App.get('isHadoopWindowsStack'),
       "category": "MetricsSink",
       "serviceName": "HDFS",
       "index": 4,
@@ -215,6 +209,7 @@ module.exports =
       "name": "sink.dblogin",
       "displayName": "Database Username",
       "isOverridable": false,
+      "isVisible": App.get('isHadoopWindowsStack'),
       "displayType": "user",
       "category": "MetricsSink",
       "serviceName": "HDFS",
@@ -226,6 +221,7 @@ module.exports =
       "name": "sink.dbpassword",
       "displayName": "Database Password",
       "isOverridable": false,
+      "isVisible": App.get('isHadoopWindowsStack'),
       "displayType": "password",
       "category": "MetricsSink",
       "serviceName": "HDFS",
@@ -237,6 +233,7 @@ module.exports =
       "name": "sink.jdbc.driver",
       "displayName": "JDBC Driver Class",
       "isOverridable": false,
+      "isVisible": App.get('isHadoopWindowsStack'),
       "category": "MetricsSink",
       "serviceName": "HDFS",
       "index": 7,
@@ -247,6 +244,7 @@ module.exports =
       "name": "sink.jdbc.url",
       "displayName": "Database URL",
       "isOverridable": false,
+      "isVisible": App.get('isHadoopWindowsStack'),
       "displayType": "advanced",
       "category": "MetricsSink",
       "serviceName": "HDFS",
@@ -2510,187 +2508,6 @@ module.exports =
       "filename": "hadoop-env.xml",
       "category": "Advanced hadoop-env"
     },
-    {
-      "id": "puppet var",
-      "name": "security_enabled",
-      "displayName": "Hadoop Security",
-      "description": "Enable hadoop security",
-      "defaultValue": 'false',
-      "isRequired": false,
-      "displayType": "checkbox",
-      "isOverridable": false,
-      "isVisible": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "kerberos_domain",
-      "displayName": "Kerberos realm",
-      "description": "Kerberos realm",
-      "defaultValue": 'EXAMPLE.COM',
-      "isRequired": false,
-      "isOverridable": false,
-      "isVisible": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "tez_tar_source",
-      "displayName": "Tez tarball source",
-      "description": "Source file path that uses dynamic variables and regex to copy the
file to HDFS.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "tez_tar_destination_folder",
-      "displayName": "Tez tarball destination folder",
-      "description": "Destination HDFS folder for the file.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "hive_tar_source",
-      "displayName": "Hive tarball source",
-      "description": "Source file path that uses dynamic variables and regex to copy the
file to HDFS.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "hive_tar_destination_folder",
-      "displayName": "Hive tarball destination folder",
-      "description": "Destination HDFS folder for the file.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "pig_tar_source",
-      "displayName": "Pig tarball source",
-      "description": "Source file path that uses dynamic variables and regex to copy the
file to HDFS.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "pig_tar_destination_folder",
-      "displayName": "Pig tarball destination folder",
-      "description": "Destination HDFS folder for the file.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "hadoop-streaming_tar_source",
-      "displayName": "hadoop-streaming.jar source",
-      "description": "Source file path that uses dynamic variables and regex to copy the
file to HDFS.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "hadoop-streaming_tar_destination_folder",
-      "displayName": "hadoop-streaming.jar destination folder",
-      "description": "Destination HDFS folder for the file.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "sqoop_tar_source",
-      "displayName": "Sqoop tarball source",
-      "description": "Source file path that uses dynamic variables and regex to copy the
file to HDFS.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "sqoop_tar_destination_folder",
-      "displayName": "Sqoop tarball destination folder",
-      "description": "Destination HDFS folder for the file.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "mapreduce_tar_source",
-      "displayName": "Mapreduce tarball source",
-      "description": "Source file path that uses dynamic variables and regex to copy the
file to HDFS.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "mapreduce_tar_destination_folder",
-      "displayName": "Mapreduce tarball destination folder",
-      "description": "Destination HDFS folder for the file.",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
 
   /**********************************************MAPREDUCE2***************************************/
     {
@@ -4435,7 +4252,6 @@ module.exports =
       "isReconfigurable": true,
       "isOverridable": false,
       "isVisible": !App.get('isHadoopWindowsStack'),
-      "serviceName": "MISC",
       "filename": "cluster-env.xml",
       "category": "Users and Groups"
     },

http://git-wip-us.apache.org/repos/asf/ambari/blob/1dbf72ef/ambari-web/app/data/PHD/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/PHD/site_properties.js b/ambari-web/app/data/PHD/site_properties.js
index bd117b1..1c6d1e5 100644
--- a/ambari-web/app/data/PHD/site_properties.js
+++ b/ambari-web/app/data/PHD/site_properties.js
@@ -1807,44 +1807,6 @@ module.exports =
       "filename": "hadoop-env.xml",
       "category": "Advanced hadoop-env"
     },
-    {
-      "id": "puppet var",
-      "name": "security_enabled",
-      "displayName": "Hadoop Security",
-      "description": "Enable hadoop security",
-      "defaultValue": 'false',
-      "isRequired": false,
-      "displayType": "checkbox",
-      "isOverridable": false,
-      "isVisible": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "kerberos_domain",
-      "displayName": "Kerberos realm",
-      "description": "Kerberos realm",
-      "defaultValue": 'EXAMPLE.COM',
-      "isRequired": false,
-      "isOverridable": false,
-      "isVisible": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
-    {
-      "id": "puppet var",
-      "name": "rpm_version",
-      "displayName": "Hadoop RPM version",
-      "description": "Hadoop RPM version",
-      "defaultValue": '',
-      "isRequired": true,
-      "isOverridable": false,
-      "isVisible": false,
-      "isEditable": false,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml"
-    },
 
   /**********************************************MAPREDUCE2***************************************/
     {
@@ -3639,21 +3601,6 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "smokeuser",
-      "displayName": "Smoke Test User",
-      "description": "The user used to run service smoke tests",
-      "defaultValue": "ambari-qa",
-      "isReconfigurable": false,
-      "displayType": "user",
-      "isOverridable": false,
-      "isVisible": App.supports.customizeSmokeTestUser,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml",
-      "category": "Users and Groups",
-      "index": 16
-    },
-    {
-      "id": "puppet var",
       "name": "tez_user",
       "displayName": "Tez User",
       "description": "User to run Tez as",
@@ -3670,21 +3617,6 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "user_group",
-      "displayName": "Hadoop Group",
-      "description": "Group that the users specified above belong to",
-      "defaultValue": "hadoop",
-      "isReconfigurable": false,
-      "displayType": "user",
-      "isOverridable": false,
-      "isVisible": true,
-      "serviceName": "MISC",
-      "filename": "cluster-env.xml",
-      "category": "Users and Groups",
-      "index": 17
-    },
-    {
-      "id": "puppet var",
       "name": "sqoop_user",
       "displayName": "Sqoop User",
       "isReconfigurable": false,
@@ -3720,7 +3652,6 @@ module.exports =
       "isReconfigurable": true,
       "isOverridable": false,
       "isVisible": true,
-      "serviceName": "MISC",
       "filename": "cluster-env.xml",
       "category": "Users and Groups"
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1dbf72ef/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 2045264..8308fe0 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -826,7 +826,7 @@ App.config = Em.Object.create({
     if (data.items.length) {
       data.items.forEach(function (item) {
         item.StackLevelConfigurations.property_type = item.StackConfigurations.property_type
|| [];
-        item.StackLevelConfigurations.service_name = 'Cluster';
+        item.StackLevelConfigurations.service_name = 'MISC';
         var property = this.createAdvancedPropertyObject(item.StackLevelConfigurations);
         if (property) properties.push(property);
       }, this);
@@ -936,7 +936,7 @@ App.config = Em.Object.create({
      * HDP stack version is 1.x
      */
     if (fileName == 'mapred-queue-acls.xml') return false;
-    item.isVisible = true;
+    item.isVisible = fileName != 'cluster-env.xml';
     var property = {
       serviceName: serviceName,
       name: item.property_name,
@@ -973,7 +973,7 @@ App.config = Em.Object.create({
       propertyData.displayName = App.format.normalizeName(config.property_name);
       propertyData.displayType = 'user';
       if (config.service_name) {
-        var propertyIndex = config.service_name == 'Cluster' ? 30 : App.StackService.find().mapProperty('serviceName').indexOf(config.service_name);
+        var propertyIndex = config.service_name == 'MISC' ? 30 : App.StackService.find().mapProperty('serviceName').indexOf(config.service_name);
         propertyData.belongsToService = [config.service_name];
         propertyData.index = propertyIndex;
       } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/1dbf72ef/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index 1e4b0b4..2ca4013 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -642,6 +642,32 @@ describe('App.config', function () {
           {
             key: 'displayType',
             e: 'password'
+          },
+          {
+            key: 'isVisible',
+            e: true
+          }
+        ]
+      },
+      {
+        name: 'ignore_groupsusers_create',
+        cases: [
+          {
+            key: 'isVisible',
+            e: false
+          }
+        ]
+      },
+      {
+        name: 'user_group',
+        cases: [
+          {
+            key: 'isVisible',
+            e: true
+          },
+          {
+            key: 'index',
+            e: 30
           }
         ]
       }
@@ -651,7 +677,16 @@ describe('App.config', function () {
     modelSetup.advancedConfigs.items.forEach(function(item) {
       properties.push(App.config.createAdvancedPropertyObject(item.StackConfigurations));
     });
-    
+    App.config.loadClusterConfigSuccess(modelSetup.advancedClusterConfigs, {url: '/cluster/configurations'},
{callback: function (items) {properties = properties.concat(items)}});
+
+    beforeEach(function () {
+      sinon.stub(App, 'get').withArgs('isHadoopWindowsStack').returns(false);
+    });
+
+    afterEach(function () {
+      App.get.restore();
+    });
+
     tests.forEach(function(test) {
       test.cases.forEach(function(testCase) {
         it('config property `{0}` `{1}` key should be`{2}`'.format(test.name, testCase.key,
testCase.e), function() {


Mime
View raw message