Esempio n. 1
0
 def __init__(self, action_graph, run_map):
     self.action_graph = action_graph
     self.run_map = run_map
     # Setup proxies
     self.proxy_action_runs_with_cleanup = proxy.CollectionProxy(
         self.get_action_runs_with_cleanup,
         [
             proxy.attr_proxy('is_running', any),
             proxy.attr_proxy('is_starting', any),
             proxy.attr_proxy('is_scheduled', any),
             proxy.attr_proxy('is_cancelled', any),
             proxy.attr_proxy('is_active', any),
             proxy.attr_proxy('is_waiting', any),
             proxy.attr_proxy('is_queued', all),
             proxy.attr_proxy('is_complete', all),
             proxy.func_proxy('queue', eager_all),
             proxy.func_proxy('cancel', eager_all),
             proxy.func_proxy('success', eager_all),
             proxy.func_proxy('fail', eager_all),
             proxy.func_proxy('ready', eager_all),
             proxy.func_proxy('cleanup', eager_all),
             proxy.func_proxy('stop', eager_all),
             proxy.attr_proxy('start_time', min_filter),
             proxy.attr_proxy('state_data', eager_all),
         ],
     )
Esempio n. 2
0
 def __init__(self, action_graph, run_map):
     self.action_graph = action_graph
     self.run_map = run_map
     # Setup proxies
     self.proxy_action_runs_with_cleanup = proxy.CollectionProxy(
         self.get_action_runs_with_cleanup,
         [
             proxy.attr_proxy('is_running', any),
             proxy.attr_proxy('is_starting', any),
             proxy.attr_proxy('is_scheduled', any),
             proxy.attr_proxy('is_cancelled', any),
             proxy.attr_proxy('is_active', any),
             proxy.attr_proxy('is_queued', all),
             proxy.attr_proxy('is_complete', all),
             proxy.func_proxy('queue', eager_all),
             proxy.func_proxy('cancel', eager_all),
             proxy.func_proxy('success', eager_all),
             proxy.func_proxy('fail', eager_all),
             proxy.func_proxy('ready', eager_all),
             proxy.func_proxy('cleanup', eager_all),
             proxy.func_proxy('stop', eager_all),
             proxy.attr_proxy('start_time', min_filter),
             proxy.attr_proxy('state_data', eager_all),
         ],
     )
Esempio n. 3
0
File: job.py Progetto: Glances/Tron
 def __init__(self):
     self.jobs = collections.MappingCollection('jobs')
     self.proxy = proxy.CollectionProxy(self.jobs.itervalues, [
         proxy.func_proxy('request_shutdown',    iteration.list_all),
         proxy.func_proxy('enable',              iteration.list_all),
         proxy.func_proxy('disable',             iteration.list_all),
         proxy.func_proxy('schedule',            iteration.list_all),
         proxy.attr_proxy('is_shutdown',         all)
     ])
Esempio n. 4
0
 def __init__(self):
     self.jobs = collections.MappingCollection('jobs')
     self.proxy = proxy.CollectionProxy(self.jobs.itervalues, [
         proxy.func_proxy('request_shutdown', iteration.list_all),
         proxy.func_proxy('enable', iteration.list_all),
         proxy.func_proxy('disable', iteration.list_all),
         proxy.func_proxy('schedule', iteration.list_all),
         proxy.attr_proxy('is_shutdown', all)
     ])
Esempio n. 5
0
    def __init__(self, config, node_pool, context):
        self.config             = config
        self.node_pool          = node_pool
        self.instances          = []
        self.context            = context

        self.instances_proxy    = proxy.CollectionProxy(
            lambda: self.instances, [
                proxy.func_proxy('stop',    iteration.list_all),
                proxy.func_proxy('start',   iteration.list_all),
                proxy.func_proxy('restore', iteration.list_all),
                proxy.attr_proxy('state_data', list)
            ])
Esempio n. 6
0
    def __init__(self, config, node_pool, context):
        self.config = config
        self.node_pool = node_pool
        self.instances = []
        self.context = context

        self.instances_proxy = proxy.CollectionProxy(lambda: self.instances, [
            proxy.func_proxy('stop', iteration.list_all),
            proxy.func_proxy('kill', iteration.list_all),
            proxy.func_proxy('start', iteration.list_all),
            proxy.func_proxy('restore', iteration.list_all),
            proxy.attr_proxy('state_data', list)
        ])