Browse Source

AMBARI-22554. UI should pass repo_name for repository validation (vsubramanian)

Vivek Ratnavel Subramanian 8 years ago
parent
commit
ca174fb32a

+ 2 - 1
ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js

@@ -405,7 +405,8 @@ angular.module('ambariAdminConsole')
               $http.post(url + '/operating_systems/' + os.OperatingSystems.os_type + '/repositories/' + repo.Repositories.repo_id + '?validate_only=true',
                 {
                   "Repositories": {
-                    "base_url": repo.Repositories.base_url
+                    "base_url": repo.Repositories.base_url,
+                    "repo_name": repo.Repositories.repo_name
                   }
                 },
                 {

+ 4 - 1
ambari-web/app/controllers/installer.js

@@ -315,7 +315,9 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
       App.Repository.find().findProperty('id', repo.id).set('baseUrl', repo.base_url);
     });
     _oses.forEach(function (os) {
-      App.OperatingSystem.find().findProperty('id', os.id).set('isSelected', os.is_selected);
+      if (App.OperatingSystem.find().findProperty('id', os.id)) {
+        App.OperatingSystem.find().findProperty('id', os.id).set('isSelected', os.is_selected);
+      }
     });
     //should delete the record on going to step 2, on going back to step 1, still need the record
     if (App.router.get('currentState.name') != "step1") {
@@ -863,6 +865,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
                   data: {
                     'Repositories': {
                       'base_url': repo.get('baseUrl'),
+                      'repo_name': repo.get('repoName'),
                       "verify_base_url": verifyBaseUrl
                     }
                   }