mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-03 01:17:56 +03:00
Fixed a bug in UserServiceManager that on "checkForRemoval" it reloads the User Service, and looses the referenced passed in.
This makes that when the service must be removed, and a reference was passed in that was also saved later, the service was not marked correctly for removal.
This commit is contained in:
parent
4ee51ac268
commit
7ca448d926
@ -447,14 +447,13 @@ class UserServiceManager(object):
|
||||
UserServiceOpChecker.makeUnique(uService, ui, state)
|
||||
return False
|
||||
|
||||
@transaction.commit_on_success
|
||||
def checkForRemoval(self, uService):
|
||||
uService = UserService.objects.select_for_update().get(id=uService.id)
|
||||
#uService = UserService.objects.select_for_update().get(id=uService.id)
|
||||
if uService.publication == None:
|
||||
return
|
||||
if uService.publication.id != uService.deployed_service.activePublication().id:
|
||||
logger.debug('Old revision of user service, marking as removable: {0}'.format(uService))
|
||||
uService.setState(State.REMOVABLE)
|
||||
uService.remove()
|
||||
|
||||
|
||||
def notifyReadyFromOsManager(self, uService, data):
|
||||
|
@ -137,8 +137,10 @@ class LinuxOsManager(osmanagers.OSManager):
|
||||
notifyReady = True
|
||||
self.notifyIp(service.unique_id, si, data)
|
||||
service.updateData(si)
|
||||
|
||||
service.setInUse(inUse)
|
||||
service.setOsState(state)
|
||||
|
||||
# If notifyReady is not true, save state, let UserServiceManager do it for us else
|
||||
if doRemove is True:
|
||||
service.remove()
|
||||
|
@ -153,8 +153,10 @@ class WindowsOsManager(osmanagers.OSManager):
|
||||
notifyReady = True
|
||||
self.notifyIp(service.unique_id, si, data)
|
||||
service.updateData(si)
|
||||
|
||||
service.setInUse(inUse)
|
||||
service.setOsState(state)
|
||||
|
||||
# If notifyReady is not true, save state, let UserServiceManager do it for us else
|
||||
if doRemove is True:
|
||||
service.remove()
|
||||
|
Loading…
Reference in New Issue
Block a user