mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-24 02:04:09 +03:00
A few improvements
This commit is contained in:
parent
6371a24d23
commit
b777919f52
@ -65,6 +65,11 @@ class DeployedServiceRemover(Job):
|
||||
super(DeployedServiceRemover, self).__init__(environment)
|
||||
|
||||
def startRemovalOf(self, ds):
|
||||
if ds.service is None: # Maybe an inconsistent value?
|
||||
logger.error('Found service pool {} without service')
|
||||
ds.delete()
|
||||
return
|
||||
|
||||
# Get publications in course...., can be at most 1!!!
|
||||
logger.debug('Removal process of {0}'.format(ds))
|
||||
|
||||
@ -131,7 +136,7 @@ class DeployedServiceRemover(Job):
|
||||
for ds in rems:
|
||||
try:
|
||||
# Skips checking deployed services in maintenance mode
|
||||
if ds.isInMaintenance():
|
||||
if ds.isInMaintenance() is False:
|
||||
self.startRemovalOf(ds)
|
||||
except Exception as e1:
|
||||
logger.error('Error removing {}: {}'.format(ds, e1))
|
||||
|
@ -43,7 +43,7 @@ from uds.models.ManagedObjectModel import ManagedObjectModel
|
||||
import logging
|
||||
|
||||
|
||||
__updated__ = '2015-05-12'
|
||||
__updated__ = '2015-11-16'
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -77,6 +77,9 @@ class Provider(ManagedObjectModel):
|
||||
'''
|
||||
return services.factory().lookup(self.data_type)
|
||||
|
||||
def isInMaintenance(self):
|
||||
return self.maintenance_mode
|
||||
|
||||
def __str__(self):
|
||||
return u"{0} of type {1} (id:{2})".format(self.name, self.data_type, self.id)
|
||||
|
||||
|
@ -47,7 +47,7 @@ from uds.models.Provider import Provider
|
||||
import logging
|
||||
|
||||
|
||||
__updated__ = '2015-05-12'
|
||||
__updated__ = '2015-11-16'
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -122,6 +122,9 @@ class Service(ManagedObjectModel):
|
||||
'''
|
||||
return self.provider.getType().getServiceByType(self.data_type)
|
||||
|
||||
def isInMaintenance(self):
|
||||
return self.provider is not None and self.provider.isInMaintenance()
|
||||
|
||||
def __str__(self):
|
||||
return u"{0} of type {1} (id:{2})".format(self.name, self.data_type, self.id)
|
||||
|
||||
|
@ -175,7 +175,7 @@ class DeployedService(UUIDModel):
|
||||
return False
|
||||
|
||||
def isInMaintenance(self):
|
||||
return self.service is not None and self.service.provider.maintenance_mode
|
||||
return self.service is not None and self.service.isInMaintenance()
|
||||
|
||||
def storeValue(self, name, value):
|
||||
'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user