Repository: ambari
Updated Branches:
  refs/heads/trunk c0dd81615 -> 15ce79a95


AMBARI-7833. Disable fileSystemCheck if there is no DFS in the stack


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

Branch: refs/heads/trunk
Commit: 15ce79a9551f88731cafc0d96e6c5bf69abc9386
Parents: c0dd816
Author: Subin <subin@SuMcPro.local>
Authored: Fri Oct 17 20:48:37 2014 +0530
Committer: Subin <subin@SuMcPro.local>
Committed: Fri Oct 17 22:00:48 2014 +0530

----------------------------------------------------------------------
 .../app/controllers/wizard/step4_controller.js  | 54 ++++++++++++++------
 1 file changed, 37 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/15ce79a9/ambari-web/app/controllers/wizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js 
b/ambari-web/app/controllers/wizard/step4_controller.js
index 3688b99..0199bd4 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -224,28 +224,48 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   },
 
   /**
+   * Checks if a filesystem is present in the Stack
+   *
+   * @method isDFSStack
+   */
+  isDFSStack: function () {
+       var bDFSStack = false;
+    var dfsServices = ['HDFS', 'GLUSTERFS'];
+    var availableServices = this.filterProperty('isInstalled',false);
+    availableServices.forEach(function(service){
+      if (dfsServices.contains(service.get('serviceName'))) {
+        console.log("found DFS " + service.get('serviceName'));
+        bDFSStack=true;
+      }
+    },this);
+    return bDFSStack;
+  },
+
+  /**
    * Checks if a filesystem is selected and only one filesystem is selected
    *
    * @method isFileSystemCheckFailed
    */
   fileSystemServiceValidation: function() {
-    var primaryDFS = this.findProperty('isPrimaryDFS',true);
-    var primaryDfsDisplayName = 
primaryDFS.get('displayNameOnSelectServicePage');
-    var primaryDfsServiceName = primaryDFS.get('serviceName');
-     if (this.multipleDFSs()) {
-       var dfsServices = 
this.filterProperty('isDFS',true).filterProperty('isSelected',true).mapProperty('serviceName');
-       var services = dfsServices.map(function (item){
-         return  {
-           serviceName: item,
-           selected: item === primaryDfsServiceName
-         };
-       });
-       this.addValidationError({
-         id: 'multipleDFS',
-         callback: this.needToAddServicePopup,
-         callbackParams: [services, 'multipleDFS', primaryDfsDisplayName]
-       });
-     }
+       if(this.isDFSStack()){
+         var primaryDFS = this.findProperty('isPrimaryDFS',true);
+         var primaryDfsDisplayName = 
primaryDFS.get('displayNameOnSelectServicePage');
+         var primaryDfsServiceName = primaryDFS.get('serviceName');
+         if (this.multipleDFSs()) {
+           var dfsServices = 
this.filterProperty('isDFS',true).filterProperty('isSelected',true).mapProperty('serviceName');
+           var services = dfsServices.map(function (item){
+             return  {
+               serviceName: item,
+               selected: item === primaryDfsServiceName
+             };
+           });
+           this.addValidationError({
+             id: 'multipleDFS',
+             callback: this.needToAddServicePopup,
+             callbackParams: [services, 'multipleDFS', primaryDfsDisplayName]
+           });
+         }
+       }
   },
 
   /**

Reply via email to