Beispiel #1
0
 def get_failure_signature(
     cls, instance, serialized_instance, force=False, **kwargs
 ):
     if force:
         return cls.get_deletion_task(instance, serialized_instance)
     else:
         return core_tasks.ErrorStateTransitionTask().s(serialized_instance)
Beispiel #2
0
def pull_hosts():
    pullable_hosts = Host.objects.exclude(
        backend_id='')  # Cannot pull hosts without backend_id
    for host in pullable_hosts.filter(state=Host.States.ERRED):
        serialized_host = core_utils.serialize_instance(host)
        core_tasks.BackendMethodTask().apply_async(
            args=(serialized_host, 'pull_host'),
            link=core_tasks.RecoverTask().si(serialized_host),
            link_error=core_tasks.ErrorMessageTask().s(serialized_host),
        )
    for host in Host.objects.filter(state=Host.States.OK):
        serialized_host = core_utils.serialize_instance(host)
        core_tasks.BackendMethodTask().apply_async(
            args=(serialized_host, 'pull_host'),
            link_error=core_tasks.ErrorStateTransitionTask().s(
                serialized_host))
Beispiel #3
0
 def get_failure_signature(cls, instance, serialized_instance, **kwargs):
     return tasks.ErrorStateTransitionTask().s(serialized_instance)