Repository: ambari
Updated Branches:
  refs/heads/trunk eeb8655ac -> 46ef6df48


AMBARI-11521 [WinTP2] Starting a service which is already running fails

Swallow the error if the service is in the target state already. Applies to 
Start() and Stop() equally.


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

Branch: refs/heads/trunk
Commit: 46ef6df48e24279b2cfae5adf344a36f7a761d4f
Parents: eeb8655
Author: Florian Barca <[email protected]>
Authored: Fri May 29 09:17:42 2015 -0700
Committer: Florian Barca <[email protected]>
Committed: Fri May 29 09:17:42 2015 -0700

----------------------------------------------------------------------
 .../src/main/python/ambari_commons/os_windows.py       | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46ef6df4/ambari-common/src/main/python/ambari_commons/os_windows.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/os_windows.py 
b/ambari-common/src/main/python/ambari_commons/os_windows.py
index 5759444..36cb384 100644
--- a/ambari-common/src/main/python/ambari_commons/os_windows.py
+++ b/ambari-common/src/main/python/ambari_commons/os_windows.py
@@ -516,8 +516,9 @@ class WinServiceController:
       if waitSecs:
         win32serviceutil.WaitForServiceStatus(serviceName, 
win32service.SERVICE_RUNNING, waitSecs)
     except win32service.error, exc:
-      msg = "Error starting service: %s" % exc.strerror
-      err = exc.winerror
+      if exc.winerror != 1056:
+        msg = "Error starting service: %s" % exc.strerror
+        err = exc.winerror
     return err, msg
 
   @staticmethod
@@ -532,8 +533,9 @@ class WinServiceController:
         if waitSecs:
           win32serviceutil.WaitForServiceStatus(serviceName, 
win32service.SERVICE_STOPPED, waitSecs)
     except win32service.error, exc:
-      msg = "Error stopping service: %s (%d)" % (exc.strerror, exc.winerror)
-      err = exc.winerror
+      if exc.winerror != 1062:
+        msg = "Error stopping service: %s (%d)" % (exc.strerror, exc.winerror)
+        err = exc.winerror
     return err, msg
 
   @staticmethod
@@ -568,7 +570,8 @@ class WinServiceController:
         if waitSecs:
           win32serviceutil.WaitForServiceStatus(serviceName, 
win32service.SERVICE_RUNNING, waitSecs)
     except win32service.error, exc:
-      err = exc.winerror
+      if exc.winerror != 1056:
+        err = exc.winerror
     return err
 
 

Reply via email to