diff --git a/apps/ops/hands.py b/apps/ops/hands.py deleted file mode 100644 index 1cdbd13a2..000000000 --- a/apps/ops/hands.py +++ /dev/null @@ -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 \ No newline at end of file diff --git a/apps/ops/tasks/__init__.py b/apps/ops/tasks/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/ops/tasks.py b/apps/ops/tasks/_celery_tasks.py similarity index 100% rename from apps/ops/tasks.py rename to apps/ops/tasks/_celery_tasks.py diff --git a/apps/ops/taskers.py b/apps/ops/tasks/taskers.py similarity index 95% rename from apps/ops/taskers.py rename to apps/ops/tasks/taskers.py index 814a202ea..d7e24dbff 100644 --- a/apps/ops/taskers.py +++ b/apps/ops/tasks/taskers.py @@ -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 diff --git a/apps/ops/views.py b/apps/ops/views.py index 5423b4942..9730098f5 100644 --- a/apps/ops/views.py +++ b/apps/ops/views.py @@ -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 *