Esempio n. 1
0
 def get_value(self, config):
     for mgr in ServiceManager.all(self.context):
         if mgr.id == config.get('manager_id', None):
             svc = mgr.get(config.get('service_id', None))
             return {
                 'id': svc.id,
                 'name': svc.name,
                 'managerId': svc.manager.id,
                 'state': svc.state,
                 'isRunning': svc.running,
             }
Esempio n. 2
0
 def get_value(self, config):
     manager_id = config.get('manager_id', None)
     service_id = config.get('service_id', None)
     if not manager_id or not service_id:
         return None
     for mgr in ServiceManager.all(self.context):
         if mgr.id == manager_id:
             svc = mgr.get_service(service_id)
             return {
                 'id': svc.id,
                 'name': svc.name,
                 'managerId': svc.manager.id,
                 'state': svc.state,
                 'isRunning': svc.running,
             }
Esempio n. 3
0
 def __init__(self, context):
     self.context = context
     self.managers = dict(
         (x.id, x) for x in ServiceManager.all(self.context))
Esempio n. 4
0
 def __init__(self, context):
     self.context = context
     self.managers = {x.id: x for x in ServiceManager.all(self.context)}
Esempio n. 5
0
 def __init__(self, context):
     self.context = context
     self.managers = dict((x.id, x) for x in ServiceManager.all(self.context))