Author: yusaku
Date: Wed May  1 21:13:39 2013
New Revision: 1478192

URL: http://svn.apache.org/r1478192
Log:
AMBARI-2054. If "Install from Local Repository" selected in install wizard, Add 
Host wizard not working. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/app.js
    incubator/ambari/trunk/ambari-web/app/controllers/wizard.js
    incubator/ambari/trunk/ambari-web/app/utils/ajax.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1478192&r1=1478191&r2=1478192&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed May  1 21:13:39 2013
@@ -823,6 +823,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2054. If "Install from Local Repository" selected in install wizard,
+ Add Host wizard not working. (yusaku)
+
  AMBARI-2053. Align "add hosts" button vertically with host health filter.
  (yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/app.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/app.js?rev=1478192&r1=1478191&r2=1478192&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/app.js (original)
+++ incubator/ambari/trunk/ambari-web/app/app.js Wed May  1 21:13:39 2013
@@ -34,6 +34,9 @@ module.exports = Em.Application.create({
    */
   stackVersionURL:function(){
     var stackVersion = this.get('currentStackVersion') || 
this.get('defaultStackVersion');
+    if(stackVersion.indexOf('HDPLocal') !== -1){
+      return '/stacks/HDPLocal/version/' + stackVersion.replace(/HDPLocal-/g, 
'');
+    }
     return '/stacks/HDP/version/' + stackVersion.replace(/HDP-/g, '');
   }.property('currentStackVersion'),
   
@@ -42,6 +45,9 @@ module.exports = Em.Application.create({
    */
   stack2VersionURL:function(){
     var stackVersion = this.get('currentStackVersion') || 
this.get('defaultStackVersion');
+    if(stackVersion.indexOf('HDPLocal') !== -1){
+      return '/stacks2/HDPLocal/versions/' + 
stackVersion.replace(/HDPLocal-/g, '');
+    }
     return '/stacks2/HDP/versions/' + stackVersion.replace(/HDP-/g, '');
   }.property('currentStackVersion'),
   clusterName: null,

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard.js?rev=1478192&r1=1478191&r2=1478192&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard.js Wed May  1 
21:13:39 2013
@@ -448,7 +448,7 @@ App.WizardController = Em.Controller.ext
       name: 'wizard.service_components',
       sender: this,
       data: {
-        stackUrl: App.get('stackVersionURL')
+        stackUrl: App.get('stack2VersionURL')
       },
       success: 'loadServiceComponentsSuccessCallback',
       error: 'loadServiceComponentsErrorCallback'
@@ -459,7 +459,7 @@ App.WizardController = Em.Controller.ext
   loadServiceComponentsSuccessCallback: function (jsonData) {
     var displayOrderConfig = require('data/services');
     console.log("TRACE: getService ajax call  -> In success function for the 
getServiceComponents call");
-    console.log("TRACE: jsonData.services : " + jsonData.services);
+    console.log("TRACE: jsonData.services : " + jsonData.items);
 
     // Creating Model
     var Service = Ember.Object.extend({
@@ -476,18 +476,18 @@ App.WizardController = Em.Controller.ext
 
     // loop through all the service components
     for (var i = 0; i < displayOrderConfig.length; i++) {
-      var entry = jsonData.services.findProperty("name", 
displayOrderConfig[i].serviceName);
+      var entry = jsonData.items.findProperty("StackServices.service_name", 
displayOrderConfig[i].serviceName);
       if (entry) {
         var myService = Service.create({
-          serviceName: entry.name,
+          serviceName: entry.StackServices.service_name,
           displayName: displayOrderConfig[i].displayName,
           isDisabled: i === 0,
           isSelected: displayOrderConfig[i].isSelected,
           canBeSelected: displayOrderConfig[i].canBeSelected,
           isInstalled: false,
           isHidden: displayOrderConfig[i].isHidden,
-          description: entry.comment,
-          version: entry.version
+          description: entry.StackServices.comments,
+          version: entry.StackServices.service_version
         });
 
         data.push(myService);

Modified: incubator/ambari/trunk/ambari-web/app/utils/ajax.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/ajax.js?rev=1478192&r1=1478191&r2=1478192&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/ajax.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/ajax.js Wed May  1 21:13:39 2013
@@ -578,7 +578,7 @@ var urls = {
     }
   },
   'wizard.service_components': {
-    'real': '{stackUrl}',
+    'real': '{stackUrl}/stackServices?fields=StackServices',
     'mock': '/data/wizard/stack/hdp/version/1.3.0.json',
     'format': function (data, opt) {
       return {


Reply via email to