Commit cd22c390 authored by Administrator's avatar Administrator

[future] 将Task移到一个包内管理

parent 32a5aec3
"""
jumpserver.__app__.hands.py
~~~~~~~~~~~~~~~~~
This app depends other apps api, function .. should be import or write mack here.
Other module of this app shouldn't connect with other app.
:copyright: (c) 2014-2016 by Jumpserver Team.
:license: GPL v2, see LICENSE for more details.
"""
from users.utils import AdminUserRequiredMixin
\ No newline at end of file
# ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals
from .tasks import *
from ops.tasks import _celery_tasks
from .models import Tasker
from ops.models import Tasker
from uuid import uuid1
from celery.result import AsyncResult
......@@ -52,7 +52,7 @@ def __get_result_by_tasker_id(tasker_uuid, deal_method):
def start_get_hardware_info(*assets):
name = "Get host hardware information"
uuid = "tasker-" + uuid1().hex
get_asset_hardware_info.delay(name, uuid, *assets)
_celery_tasks.get_asset_hardware_info.delay(name, uuid, *assets)
return uuid
......@@ -90,7 +90,7 @@ def get_hardware_info(tasker_uuid):
def start_ping_test(*assets):
name = "Test host connection"
uuid = "tasker-" + uuid1().hex
asset_test_ping_check.delay(name, uuid, *assets)
_celery_tasks.asset_test_ping_check.delay(name, uuid, *assets)
return uuid
......
......@@ -6,7 +6,7 @@ from django.views.generic.list import ListView, MultipleObjectMixin
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.views.generic.detail import DetailView, SingleObjectMixin
from .hands import AdminUserRequiredMixin
from users.utils import AdminUserRequiredMixin
from .utils.mixins import CreateSudoPrivilegesMixin, ListSudoPrivilegesMixin
from models import *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment