Massive reworking of how Services are created

This commit is contained in:
2010-10-14 10:28:39 +01:00
parent da3d694a4a
commit df1bdde396
4 changed files with 34 additions and 78 deletions

View File

@@ -24,30 +24,6 @@ class RemoveInvalidUsers():
# For each user, update access list based on Corp details
user.get_profile().update_access()
class ValidateDisabledUsers():
"""
Cycles through all users, and disables any Service Account of disabled
users.
"""
# run daily
run_every = 84600
@property
def _logger(self):
if not hasattr(self, '__logger'):
self.__logger = logging.getLogger(__name__)
return self.__logger
def job(self):
for servacc in ServiceAccount.objects.filter(active=0):
self._logger.info('Checking %s' % servacc)
api = servacc.service.api_class
api.settings = servacc.service.settings
if not api.disable_user(servacc.service_uid):
self._logger.error('Error disabling %s on %s' % (servacc, servacc.service))
class UpdateServiceGroups():
"""
Cycles through all service accounts and updates group access.