1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Merge remote-tracking branch 'origin/v2.2'

This commit is contained in:
Adolfo Gómez García 2019-02-24 11:49:14 +01:00
commit 6a7d10bf1d
3 changed files with 5 additions and 4 deletions

View File

@ -548,7 +548,7 @@ class UserServiceManager(object):
elif uService.state in (State.USABLE, State.PREPARING): # We don't want to get active deleting or deleted machines...
uService.setState(State.PREPARING)
UserServiceOpChecker.makeUnique(uService, ui, state)
uService.save(update_fields=['in_use', 'in_use_date', 'os_state', 'state', 'state_date', 'data'])
uService.save(update_fields=['os_state'])
except Exception as e:
logger.exception('Unhandled exception on notyfyReady: {}'.format(e))
uService.setState(State.ERROR)

View File

@ -212,7 +212,7 @@ class UserServiceOpChecker(DelayedTask):
logger.exception('Checking service state')
log.doLog(userService, log.ERROR, 'Exception: {0}'.format(e), log.INTERNAL)
userService.setState(State.ERROR)
userService.save(update_fields=['data', 'state', 'state_date'])
userService.save(update_fields=['data'])
@staticmethod
def checkLater(userService, ci):

View File

@ -324,6 +324,8 @@ class UserService(UUIDModel):
self.state = state
self.save(update_fields=['state', 'state_date'])
self.save(update_fields=['state', 'state_date'])
def setOsState(self, state):
"""
Updates the os state (state of the os) of this object and, optionally, saves it
@ -348,8 +350,7 @@ class UserService(UUIDModel):
self.cache_level = 0
self.state_date = getSqlDatetime()
self.user = user
if save:
self.save(update_fields=['cache_level', 'state_date', 'user'])
self.save(update_fields=['cache_level', 'state_date', 'user'])
def setInUse(self, state):
"""