1
0
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:
Adolfo Gómez 2013-06-19 10:49:40 +00:00
parent 4ee51ac268
commit 7ca448d926
3 changed files with 6 additions and 3 deletions

View File

@ -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):

View File

@ -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()

View File

@ -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()