mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-17 15:59:04 +00:00
[future] 将Task移到一个包内管理
This commit is contained in:
@@ -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
|
|
0
apps/ops/tasks/__init__.py
Normal file
0
apps/ops/tasks/__init__.py
Normal file
@@ -1,9 +1,9 @@
|
|||||||
# ~*~ coding: utf-8 ~*~
|
# ~*~ coding: utf-8 ~*~
|
||||||
from __future__ import unicode_literals
|
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 uuid import uuid1
|
||||||
from celery.result import AsyncResult
|
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):
|
def start_get_hardware_info(*assets):
|
||||||
name = "Get host hardware information"
|
name = "Get host hardware information"
|
||||||
uuid = "tasker-" + uuid1().hex
|
uuid = "tasker-" + uuid1().hex
|
||||||
get_asset_hardware_info.delay(name, uuid, *assets)
|
_celery_tasks.get_asset_hardware_info.delay(name, uuid, *assets)
|
||||||
return uuid
|
return uuid
|
||||||
|
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ def get_hardware_info(tasker_uuid):
|
|||||||
def start_ping_test(*assets):
|
def start_ping_test(*assets):
|
||||||
name = "Test host connection"
|
name = "Test host connection"
|
||||||
uuid = "tasker-" + uuid1().hex
|
uuid = "tasker-" + uuid1().hex
|
||||||
asset_test_ping_check.delay(name, uuid, *assets)
|
_celery_tasks.asset_test_ping_check.delay(name, uuid, *assets)
|
||||||
return uuid
|
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.edit import CreateView, DeleteView, UpdateView
|
||||||
from django.views.generic.detail import DetailView, SingleObjectMixin
|
from django.views.generic.detail import DetailView, SingleObjectMixin
|
||||||
|
|
||||||
from .hands import AdminUserRequiredMixin
|
from users.utils import AdminUserRequiredMixin
|
||||||
from .utils.mixins import CreateSudoPrivilegesMixin, ListSudoPrivilegesMixin
|
from .utils.mixins import CreateSudoPrivilegesMixin, ListSudoPrivilegesMixin
|
||||||
from models import *
|
from models import *
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user