ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [1/6] ambari git commit: AMBARI-11156. Ranger Yarn Plugin Status - to be shown in Summary for Ranger (alexantonenko)
Date Fri, 15 May 2015 09:53:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 94ba7c0f9 -> d239381eb


AMBARI-11156. Ranger Yarn Plugin Status - to be shown in Summary for Ranger (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 68d02943a9d5df28587a7f89a900b4a9d746226a
Parents: 5e8e7ac
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri May 15 11:01:51 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Fri May 15 12:53:45 2015 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/summary.js    |  8 ++++-
 .../main/service/info/summary_test.js           | 34 ++++++++++++++++----
 2 files changed, 34 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/68d02943/ambari-web/app/controllers/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js
index 137b5e4..ca661d3 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -73,6 +73,11 @@ App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMix
       serviceName: 'STORM',
       type: 'ranger-storm-plugin-properties',
       propertyName: 'ranger-storm-plugin-enabled'
+    },
+    {
+      serviceName: 'YARN',
+      type: 'ranger-yarn-plugin-properties',
+      propertyName: 'ranger-yarn-plugin-enabled'
     }
   ],
 
@@ -95,7 +100,8 @@ App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMix
           var displayName = (stackService) ? stackService.get('displayName') : item.serviceName;
           return $.extend(item, {
             pluginTitle: Em.I18n.t('services.service.summary.ranger.plugin.title').format(displayName),
-            isDisplayed: App.Service.find().someProperty('serviceName', item.serviceName),
+            isDisplayed: App.Service.find().someProperty('serviceName', item.serviceName)
&&
+              stackService.get('configTypes').hasOwnProperty(item.type),
             status: Em.I18n.t('services.service.summary.ranger.plugin.loadingStatus')
           });
         }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/68d02943/ambari-web/test/controllers/main/service/info/summary_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/info/summary_test.js b/ambari-web/test/controllers/main/service/info/summary_test.js
index 18ef3c4..695dbad 100644
--- a/ambari-web/test/controllers/main/service/info/summary_test.js
+++ b/ambari-web/test/controllers/main/service/info/summary_test.js
@@ -62,29 +62,49 @@ describe('App.MainServiceInfoSummaryController', function () {
           serviceName: 'HDFS'
         }),
         Em.Object.create({
-          serviceName: 'HIVE'
+          serviceName: 'YARN'
         })
       ]);
       sinon.stub(App.StackService, 'find').returns([
         Em.Object.create({
           serviceName: 'HDFS',
-          displayNName: 'HDFS'
+          displayName: 'HDFS',
+          configTypes: {
+            'ranger-hdfs-plugin-properties': {}
+          }
         }),
         Em.Object.create({
           serviceName: 'HIVE',
-          displayNName: 'Hive'
+          displayName: 'Hive',
+          configTypes: {
+            'ranger-hive-plugin-properties': {}
+          }
         }),
         Em.Object.create({
           serviceName: 'HBASE',
-          displayNName: 'HBase'
+          displayName: 'HBase',
+          configTypes: {
+            'ranger-hbase-plugin-properties': {}
+          }
         }),
         Em.Object.create({
           serviceName: 'KNOX',
-          displayNName: 'Knox'
+          displayName: 'Knox',
+          configTypes: {
+            'ranger-knox-plugin-properties': {}
+          }
         }),
         Em.Object.create({
           serviceName: 'STORM',
-          displayNName: 'Storm'
+          displayName: 'Storm',
+          configTypes: {
+            'ranger-storm-plugin-properties': {}
+          }
+        }),
+        Em.Object.create({
+          serviceName: 'YARN',
+          displayName: 'YARN',
+          configTypes: {}
         })
       ]);
     });
@@ -99,7 +119,7 @@ describe('App.MainServiceInfoSummaryController', function () {
         controller.set('isRangerPluginsArraySet', item.isRangerPluginsArraySet);
         App.set('router.clusterController.isLoaded', item.isLoaded);
         expect(controller.get('isRangerPluginsArraySet')).to.equal(item.expectedIsRangerPluginsArraySet);
-        expect(controller.get('rangerPlugins').filterProperty('isDisplayed').mapProperty('serviceName').sort()).to.eql(['HDFS',
'HIVE']);
+        expect(controller.get('rangerPlugins').filterProperty('isDisplayed').mapProperty('serviceName').sort()).to.eql(['HDFS']);
       });
     });
 


Mime
View raw message