Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 7abf5207b -> 15c6f5a3c


AMBARI-21807. 'Move Hive Metastore' wizard is stuck while configuring 
MYSQL_SERVER. (jaimin)


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

Branch: refs/heads/branch-2.5
Commit: 15c6f5a3ce8b10da25c383edd99455793fbdd25b
Parents: 7abf520
Author: Jaimin Jetly <jai...@hortonworks.com>
Authored: Tue Aug 29 20:20:20 2017 -0700
Committer: Jaimin Jetly <jai...@hortonworks.com>
Committed: Tue Aug 29 20:20:20 2017 -0700

----------------------------------------------------------------------
 .../main/service/reassign/step1_controller.js          | 13 +++++++++----
 .../main/service/reassign/step1_controller_test.js     |  2 ++
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/15c6f5a3/ambari-web/app/controllers/main/service/reassign/step1_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step1_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
index c631e85..12d77d3 100644
--- a/ambari-web/app/controllers/main/service/reassign/step1_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
@@ -93,8 +93,7 @@ App.ReassignMasterWizardStep1Controller = 
Em.Controller.extend({
       databaseTypeMatch,
       properties = {},
       configs = {},
-      dbPropertyMapItem = Em.getWithDefault(this.get('dbPropertyMap'), 
this.get('content.reassign.component_name'), null),
-      serviceDbProp = this.get('content.reassign.service_id').toLowerCase() + 
'_database';
+      dbPropertyMapItem = Em.getWithDefault(this.get('dbPropertyMap'), 
this.get('content.reassign.component_name'), null);
 
     data.items.forEach(function(item) {
       configs[item.type] = item.properties;
@@ -118,8 +117,7 @@ App.ReassignMasterWizardStep1Controller = 
Em.Controller.extend({
       App.router.reassignMasterController.set('content.hasManualSteps', false);
     }
 
-    properties['is_remote_db'] = /Existing/ig.test(properties[serviceDbProp]);
-
+    properties['is_remote_db'] = this.isExistingDb(configs);
     properties['database_hostname'] = this.getDatabaseHost();
 
     this.saveDatabaseType(databaseType);
@@ -145,6 +143,13 @@ App.ReassignMasterWizardStep1Controller = 
Em.Controller.extend({
     }
   },
 
+  isExistingDb: function(configs) {
+    var serviceName =  this.get('content.reassign.service_id').toLowerCase();
+    var serviceDbSite = serviceName + '-env';
+    var serviceDbConfig = serviceName + '_database';
+    return  /Existing/ig.test(configs[serviceDbSite][serviceDbConfig]);
+  },
+
   getDatabaseHost: function() {
     var db_type = this.get('databaseType'),
       connectionURLProps = {

http://git-wip-us.apache.org/repos/asf/ambari/blob/15c6f5a3/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js 
b/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
index 7dbf24a..0a75903 100644
--- a/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
@@ -109,6 +109,7 @@ describe('App.ReassignMasterWizardStep1Controller', 
function () {
       controller.set('_super', Em.K);
 
       sinon.stub(controller, 'getDatabaseHost', Em.K);
+      sinon.stub(controller, 'isExistingDb', Em.K);
       sinon.stub(controller, 'saveDatabaseType', Em.K);
       sinon.stub(controller, 'saveServiceProperties', Em.K);
       sinon.stub(controller, 'saveConfigs', Em.K);
@@ -119,6 +120,7 @@ describe('App.ReassignMasterWizardStep1Controller', 
function () {
 
     afterEach(function() {
       controller.getDatabaseHost.restore();
+      controller.isExistingDb.restore();
       controller.saveDatabaseType.restore();
       controller.saveServiceProperties.restore();
       controller.saveConfigs.restore();

Reply via email to