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

pull/530/head
Administrator 2016-11-23 11:45:50 +08:00
parent 32a5aec34e
commit cd22c39078
5 changed files with 5 additions and 19 deletions

View File

@ -1,14 +0,0 @@
"""
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

View File

View File

@ -1,9 +1,9 @@
# ~*~ 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

View File

@ -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 *