You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/06/20 22:28:29 UTC

ambari git commit: AMBARI-12047. Auto Stop/Start of services after keytab regeneration should check for failed stop (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk e35b02e7d -> f7220786b


AMBARI-12047. Auto Stop/Start of services after keytab regeneration should check for failed stop  (alexantonenko)


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

Branch: refs/heads/trunk
Commit: f7220786bba1af48773b0c6242ddb436b86a577f
Parents: e35b02e
Author: Alex Antonenko <hi...@gmail.com>
Authored: Sat Jun 20 22:33:41 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Sat Jun 20 23:28:24 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service.js | 42 ++++++++++++++++---------
 1 file changed, 27 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f7220786/ambari-web/app/controllers/main/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js
index 6b2a1c2..d87c15c 100644
--- a/ambari-web/app/controllers/main/service.js
+++ b/ambari-web/app/controllers/main/service.js
@@ -177,6 +177,16 @@ App.MainServiceController = Em.ArrayController.extend({
     });
   },
 
+  isStopAllServicesFailed: function() {
+    var workStatuses = App.Service.find().mapProperty('workStatus');
+    for (var i = 0; i < workStatuses.length; i++) {
+      if (workStatuses[i] != 'INSTALLED' && workStatuses[i] != 'STOPPING') {
+        return true;
+      }
+    }
+    return false;
+  },
+
   /**
    * Success callback for silent stop
    */
@@ -198,21 +208,23 @@ App.MainServiceController = Em.ArrayController.extend({
    * Silent start all services - without user confirmation
    */
   silentStartAllServices: function () {
-    if (!App.router.get('backgroundOperationsController').get('allOperationsCount')) {
-      if (this.get('shouldStart')) {
-        this.set('shouldStart', false);
-        return App.ajax.send({
-          name: 'common.services.update',
-          sender: this,
-          data: {
-            context: App.BackgroundOperationsController.CommandContexts.START_ALL_SERVICES,
-            ServiceInfo: {
-              state: 'STARTED'
-            }
-          },
-          success: 'silentCallSuccessCallback'
-        });
-      }
+    if (
+      !App.router.get('backgroundOperationsController').get('allOperationsCount')
+      && this.get('shouldStart')
+      && !this.isStopAllServicesFailed()
+    ) {
+      this.set('shouldStart', false);
+      return App.ajax.send({
+        name: 'common.services.update',
+        sender: this,
+        data: {
+          context: App.BackgroundOperationsController.CommandContexts.START_ALL_SERVICES,
+          ServiceInfo: {
+            state: 'STARTED'
+          }
+        },
+        success: 'silentCallSuccessCallback'
+      });
     }
   }.observes('shouldStart', 'controllers.backgroundOperationsController.allOperationsCount'),