You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2016/02/01 10:31:24 UTC

[1/2] ambari git commit: AMBARI-14857 Ambari UI does not accept dfs.data.dir entries with file protocol when enabling 'storage type' feature. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 7444981ff -> 40a0ef623


AMBARI-14857 Ambari UI does not accept dfs.data.dir entries with file protocol when enabling 'storage type' feature. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: e15ed4429d5bf8e7c2861342c9b890665fbd1ab7
Parents: 7444981
Author: ababiichuk <ab...@hortonworks.com>
Authored: Mon Feb 1 11:02:54 2016 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Mon Feb 1 11:02:54 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/utils/validator.js       | 2 +-
 ambari-web/test/utils/validator_test.js | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e15ed442/ambari-web/app/utils/validator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/validator.js b/ambari-web/app/utils/validator.js
index 82c9f47..6426163 100644
--- a/ambari-web/app/utils/validator.js
+++ b/ambari-web/app/utils/validator.js
@@ -76,7 +76,7 @@ module.exports = {
    * @returns {boolean}
    */
   isValidDataNodeDir: function(value) {
-    var dirRegex = /^(\[[0-9a-zA-Z]+\])?(\/[0-9a-z]*)/;
+    var dirRegex = /^(\[[0-9a-zA-Z]+\])?(file:\/\/)?(\/[0-9a-z]*)/;
     var winRegex = /^(\[[0-9a-zA-Z]+\])?[a-zA-Z]:\\[0-9a-zA-Z]*/;
     var winUrlRegex = /^(\[[0-9a-zA-Z]+\])?file:\/\/\/[a-zA-Z]:\/[0-9a-zA-Z]*/;
     var dirs = value.split(',');

http://git-wip-us.apache.org/repos/asf/ambari/blob/e15ed442/ambari-web/test/utils/validator_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/validator_test.js b/ambari-web/test/utils/validator_test.js
index 5ff6185..ef90561 100644
--- a/ambari-web/test/utils/validator_test.js
+++ b/ambari-web/test/utils/validator_test.js
@@ -327,6 +327,7 @@ describe('validator', function () {
       {m:'"/1a2b3c" - valid',i:'/1a2b3c',e:true},
       {m:'"[ssd]/1a2b3c" - valid',i:'[ssd]/1a2b3c',e:true},
       {m:'"[DISK]/1a2b3c" - valid',i:'[DISK]/1a2b3c',e:true},
+      {m:'"[DISK]file:///1a2b3c" - valid',i:'[DISK]file:///1a2b3c',e:true},
       {m:'"[] /1a2b3c" - invalid',i:'[] /1a2b3c',e:false},
       {m:'"[ssd] /1a2b3c" - invalid',i:'[ssd] /1a2b3c',e:false},
       {m:'"[/1a2b3c]" - invalid',i:'[/1a2b3c]',e:false},


[2/2] ambari git commit: AMBARI-14858 Can't delete service if install failed.(ababiichuk)

Posted by ab...@apache.org.
AMBARI-14858 Can't delete service if install failed.(ababiichuk)


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

Branch: refs/heads/trunk
Commit: 40a0ef623d3b213213ac5a8340ed825b535b0234
Parents: e15ed44
Author: ababiichuk <ab...@hortonworks.com>
Authored: Mon Feb 1 11:12:58 2016 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Mon Feb 1 11:12:58 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js |  2 +-
 ambari-web/app/models/service.js                | 43 ++++++++++++++++++++
 .../test/controllers/main/service/item_test.js  | 13 ++++--
 3 files changed, 54 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/40a0ef62/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index b8ad011..4678c64 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -997,7 +997,7 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
       });
     } else if (dependentServices.length > 0) {
       this.dependentServicesWarning(serviceName, dependentServices);
-    } else if (App.Service.find(serviceName).get('workStatus') === 'INSTALLED') {
+    } else if (App.Service.allowUninstallStates.contains(App.Service.find(serviceName).get('workStatus'))) {
       App.showConfirmationPopup(
         function() {self.confirmDeleteService(serviceName)},
         Em.I18n.t('services.service.delete.popup.warning').format(displayName),

http://git-wip-us.apache.org/repos/asf/ambari/blob/40a0ef62/ambari-web/app/models/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index eba0fe9..39a6b1c 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -158,6 +158,49 @@ App.Service = DS.Model.extend({
 
 });
 
+/**
+ * Map of all service states
+ *
+ * @type {Object}
+ */
+App.Service.statesMap = {
+  init: 'INIT',
+  installing: 'INSTALLING',
+  install_failed: 'INSTALL_FAILED',
+  stopped: 'INSTALLED',
+  starting: 'STARTING',
+  started: 'STARTED',
+  stopping: 'STOPPING',
+  uninstalling: 'UNINSTALLING',
+  uninstalled: 'UNINSTALLED',
+  wiping_out: 'WIPING_OUT',
+  upgrading: 'UPGRADING',
+  maintenance: 'MAINTENANCE',
+  unknown: 'UNKNOWN'
+};
+
+/**
+ * @type {String[]}
+ */
+App.Service.inProgressStates = [
+  App.Service.statesMap.installing,
+  App.Service.statesMap.starting,
+  App.Service.statesMap.stopping,
+  App.Service.statesMap.uninstalling,
+  App.Service.statesMap.upgrading,
+  App.Service.statesMap.wiping_out
+];
+
+/**
+ * @type {String[]}
+ */
+App.Service.allowUninstallStates = [
+  App.Service.statesMap.init,
+  App.Service.statesMap.install_failed,
+  App.Service.statesMap.stopped,
+  App.Service.statesMap.unknown
+];
+
 App.Service.Health = {
   live: "LIVE",
   dead: "DEAD-RED",

http://git-wip-us.apache.org/repos/asf/ambari/blob/40a0ef62/ambari-web/test/controllers/main/service/item_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/item_test.js b/ambari-web/test/controllers/main/service/item_test.js
index de09e1a..90a1d90 100644
--- a/ambari-web/test/controllers/main/service/item_test.js
+++ b/ambari-web/test/controllers/main/service/item_test.js
@@ -1250,21 +1250,28 @@ describe('App.MainServiceItemController', function () {
 
     it("service has installed dependent services", function() {
       this.mockDependentServices.returns(['S2']);
-      this.mockService.returns(Em.Object.create({workStatus: 'INSTALLED'}));
+      this.mockService.returns(Em.Object.create({workStatus: App.Service.statesMap.stopped}));
       mainServiceItemController.deleteService('S1');
       expect(mainServiceItemController.dependentServicesWarning.calledWith('S1', ['S2'])).to.be.true;
     });
 
     it("service has not dependent services, and stopped", function() {
       this.mockDependentServices.returns([]);
-      this.mockService.returns(Em.Object.create({workStatus: 'INSTALLED'}));
+      this.mockService.returns(Em.Object.create({workStatus: App.Service.statesMap.stopped}));
+      mainServiceItemController.deleteService('S1');
+      expect(App.showConfirmationPopup.calledOnce).to.be.true;
+    });
+
+    it("service has not dependent services, and install failed", function() {
+      this.mockDependentServices.returns([]);
+      this.mockService.returns(Em.Object.create({workStatus: App.Service.statesMap.install_failed}));
       mainServiceItemController.deleteService('S1');
       expect(App.showConfirmationPopup.calledOnce).to.be.true;
     });
 
     it("service has not dependent services, and not stopped", function() {
       this.mockDependentServices.returns([]);
-      this.mockService.returns(Em.Object.create({workStatus: 'STARTED'}));
+      this.mockService.returns(Em.Object.create({workStatus: App.Service.statesMap.started}));
       mainServiceItemController.deleteService('S1');
       expect(App.ModalPopup.show.calledWith({
         secondary: null,