Revert "AMBARI-18662. Check that Stack Version and repo URLs match up when registering repo (alexantonenko)"
This reverts commit 00f1e71b62f4133e70d7d8f9f2cd6fa0624ec40d. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2cd12ce4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2cd12ce4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2cd12ce4 Branch: refs/heads/branch-feature-AMBARI-18456 Commit: 2cd12ce4cebcf0a3a6fa58ff6f79a79b0a92f631 Parents: 149104c Author: Alex Antonenko <[email protected]> Authored: Fri Dec 2 20:22:01 2016 +0200 Committer: Alex Antonenko <[email protected]> Committed: Tue Dec 6 19:04:30 2016 +0200 ---------------------------------------------------------------------- ambari-web/app/controllers/installer.js | 3 +-- .../app/controllers/wizard/step1_controller.js | 21 +------------------- ambari-web/app/messages.js | 2 -- ambari-web/test/controllers/installer_test.js | 13 +++++------- 4 files changed, 7 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/app/controllers/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js index f736ba3..e2c60c4 100644 --- a/ambari-web/app/controllers/installer.js +++ b/ambari-web/app/controllers/installer.js @@ -841,7 +841,6 @@ App.InstallerController = App.WizardController.extend({ selectedStack.get('operatingSystems').forEach(function (os) { if (os.get('isSelected') && !os.get('isEmpty')) { os.get('repositories').forEach(function (repo) { - if (!repo.get('isUtils') && wizardStep1Controller.inappropriateUrlForStackVersion(repo, stackVersion)) return; repo.setProperties({ errorTitle: '', errorContent: '', @@ -889,8 +888,8 @@ App.InstallerController = App.WizardController.extend({ } } this.set('validationCnt', this.get('validationCnt') - 1); - this.set('content.isCheckInProgress', false); if (!this.get('validationCnt')) { + this.set('content.isCheckInProgress', false); data.dfd.resolve(); } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/app/controllers/wizard/step1_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step1_controller.js b/ambari-web/app/controllers/wizard/step1_controller.js index 72f3944..f397cd8 100644 --- a/ambari-web/app/controllers/wizard/step1_controller.js +++ b/ambari-web/app/controllers/wizard/step1_controller.js @@ -272,25 +272,6 @@ App.WizardStep1Controller = Em.Controller.extend({ this.selectStackBy('id', event.context.get('id')); }, - inappropriateUrlForStackVersion: function (repo, stackVersion) { - var baseUrl = repo.get('baseUrl'), - splittedBaseUrlArray = baseUrl.split('/'), - versionInUrl = baseUrl[baseUrl.length - 1] === '/' ? splittedBaseUrlArray[splittedBaseUrlArray.length - 2] : - splittedBaseUrlArray[splittedBaseUrlArray.length - 1], - versionInUrlString = String(parseFloat(versionInUrl)), - UrlIsInvalidForStackVersion = versionInUrlString !== stackVersion; - - if (UrlIsInvalidForStackVersion) { - repo.setProperties({ - validation: App.Repository.validation.INVALID, - errorTitle: Em.I18n.t("installer.step1.error.inappropriateUrlForStackVersion.title"), - errorContent: Em.I18n.t("installer.step1.error.inappropriateUrlForStackVersion.content").format(stackVersion, versionInUrlString) - }); - } - - return UrlIsInvalidForStackVersion; - }, - /** * Show popup with options to upload new version * @@ -461,7 +442,7 @@ App.WizardStep1Controller = Em.Controller.extend({ */ enterUrlRadioButton: App.RadioButtonView.extend({ labelTranslate: 'installer.step1.useLocalRepo.enterUrl', - checked: Em.computed.alias('controller.optionsToSelect.useLocalRepo.enterUrl.isSelected'), + checked: Em.computed.alias('controller.optionsToSelect.useLocalRepo.enterUrl.isSelected') }), click: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 090244c..595cd5d 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -642,8 +642,6 @@ Em.I18n.translations = { 'installer.step1.invalidURLAttention': '<b>Attention:</b> Please make sure all repository URLs are valid before proceeding.', 'installer.step1.checkAtLeastOneAttention': '<b>Attention:</b> Please check at least one repository.', 'installer.step1.retryRepoUrls': 'Click <b>here</b> to retry.', - 'installer.step1.error.inappropriateUrlForStackVersion.title':'Inappropriate Url for selected Stack Version', - 'installer.step1.error.inappropriateUrlForStackVersion.content': 'Your stack version is {0} when version in Url is {1}', 'installer.step2.header':'Install Options', 'installer.step2.body':'Enter the list of hosts to be included in the cluster and provide your SSH key.', http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/test/controllers/installer_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/installer_test.js b/ambari-web/test/controllers/installer_test.js index 63578bc..441af87 100644 --- a/ambari-web/test/controllers/installer_test.js +++ b/ambari-web/test/controllers/installer_test.js @@ -75,8 +75,8 @@ describe('App.InstallerController', function () { Em.Object.create({ isSelected: true, reload: false, - id: 'nn-2.5', - stackNameVersion: 'nn-2.5', + id: 'nn-cc', + stackNameVersion: 'nn-cc', repositories: Em.A([ Em.Object.create({ isSelected: true, @@ -89,7 +89,6 @@ describe('App.InstallerController', function () { isEmpty: false, repositories: Em.A([ Em.Object.create({ - baseUrl: 'url/2.5', isEmpty: false, errorTitle: '1', errorContent: '1', @@ -101,8 +100,7 @@ describe('App.InstallerController', function () { }) ]); var wizard = Em.Object.create({ - skipValidationChecked: true, - inappropriateUrlForStackVersion: App.WizardStep1Controller.create().inappropriateUrlForStackVersion + skipValidationChecked: true }); it ('Should reload installed stacks', function() { @@ -116,8 +114,8 @@ describe('App.InstallerController', function () { { "isSelected": true, "reload": true, - "id": "nn-2.5", - "stackNameVersion": 'nn-2.5', + "id": "nn-cc", + "stackNameVersion": 'nn-cc', "repositories": [ { "isSelected": true, @@ -130,7 +128,6 @@ describe('App.InstallerController', function () { "isEmpty": false, "repositories": [ { - "baseUrl": "url/2.5", "isEmpty": false, "errorTitle": "", "errorContent": "",
