Permalink
Browse files

AMBARI-1059. Refactor cluster management. (yusaku)

  • Loading branch information...
Yusaku Sako
Yusaku Sako committed Dec 9, 2012
1 parent b721857 commit 19a5aeee7f6ea90fe16efb7c8e9671e80710fc2e
@@ -36,11 +36,6 @@ App.WizardStep2Controller = Em.Controller.extend({
return this.get('content.localRepo');
}.property('content.localRepo'),
-
- localRepoPath: function () {
- return this.get('content.localRepoPath');
- }.property('content.localRepoPath'),
-
sshKey: function () {
return this.get('content.sshKey');
}.property('content.sshKey'),
@@ -92,18 +87,6 @@ App.WizardStep2Controller = Em.Controller.extend({
return null;
}.property('sshKey', 'manualInstall', 'hasSubmitted'),
- localRepoError: function () {
- if (
- // (typeof this.get('localRepoPath') === 'undefined') ||
- !(/^([-a-z0-9._\/]|%[0-9a-f]{2})*$/i.test(this.get('localRepoPath')) ) ||
- (this.get('hasSubmitted') && this.get('localRepo') && this.get('localRepoPath').trim() === '' )
- )
- {
- return Em.I18n.t('installer.step2.localRepo.error.required');
- }
- return null;
- }.property('localRepo', 'localRepoPath', 'hasSubmitted'),
-
/**
* Get host info, which will be saved in parent controller
*/
@@ -183,7 +166,7 @@ App.WizardStep2Controller = Em.Controller.extend({
},
isSubmitDisabled: function () {
- return (this.get('hostsError') || this.get('sshKeyError') || this.get('localRepoError'));
- }.property('hostsError', 'sshKeyError', 'localRepoError')
+ return (this.get('hostsError') || this.get('sshKeyError'));
+ }.property('hostsError', 'sshKeyError')
});
@@ -50,7 +50,14 @@ App.WizardStep3Controller = Em.Controller.extend({
}
} else {
this.set('bootHosts', this.get('hosts'));
- this.isHostsRegistered();
+ if (App.testMode && App.skipBootstrap) {
+ this.get('bootHosts').setEach('bootStatus', 'REGISTERED');
+ this.get('bootHosts').setEach('cpu', '2');
+ this.get('bootHosts').setEach('memory', '2000000');
+ this.getHostInfo();
+ } else {
+ this.isHostsRegistered();
+ }
}
},
@@ -258,12 +265,7 @@ App.WizardStep3Controller = Em.Controller.extend({
timeout: App.timeout,
success: function (data) {
console.log('registration attempt #' + self.get('registrationAttempts'));
- var jsonData;
- if (App.testMode === true) {
- jsonData = data;
- } else {
- jsonData = jQuery.parseJSON(data);
- }
+ var jsonData = App.testMode ? data : jQuery.parseJSON(data);
if (!jsonData) {
console.log("Error: jsonData is null");
return;
@@ -348,12 +350,7 @@ App.WizardStep3Controller = Em.Controller.extend({
contentType: 'application/json',
timeout: App.timeout,
success: function (data) {
- var jsonData;
- if (App.testMode) {
- jsonData = data;
- } else {
- jsonData = jQuery.parseJSON(data);
- }
+ var jsonData = App.testMode ? data : jQuery.parseJSON(data);
hosts.forEach(function (_host) {
var host = jsonData.items.findProperty('Hosts.host_name', _host.name);
if (host) {
Oops, something went wrong.

0 comments on commit 19a5aee

Please sign in to comment.