Bugs item #1208081, was opened at 2005-05-25 05:48
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1208081&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: win32
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Michael Schall (schallm)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix: WaitForServiceStatus doesn't work for remote boxes
Initial Comment:
The machine name is not passed to QueryServiceStatus.
Current code:
now_status = QueryServiceStatus(serviceName)[1]
Fixed code:
now_status = QueryServiceStatus(serviceName,
machine)[1]
Full function:
def WaitForServiceStatus(serviceName, status, waitSecs,
machine=None):
"""Waits for the service to return the specified
status. You
should have already requested the service to enter
that state"""
hscm =
win32service.OpenSCManager(machine,None,win32service.SC_MANAGER_ALL_ACCESS)
for i in range(waitSecs*4):
now_status = QueryServiceStatus(serviceName,
machine)[1]
if now_status == status:
break
win32api.Sleep(250)
else:
raise pywintypes.error,
(winerror.ERROR_SERVICE_REQUEST_TIMEOUT,
"QueryServiceStatus",
win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2])
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2005-06-26 22:47
Message:
Logged In: YES
user_id=14198
Thanks!
Checking in win32serviceutil.py;
new revision: 1.21; previous revision: 1.20
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1208081&group_id=78018
|