mirror of https://github.com/jumpserver/jumpserver
				
				
				
			
							parent
							
								
									7f1cbc8336
								
							
						
					
					
						commit
						d7946ccb6f
					
				| 
						 | 
				
			
			@ -3,6 +3,7 @@ from rest_framework.response import Response
 | 
			
		|||
 | 
			
		||||
from accounts import serializers
 | 
			
		||||
from accounts.tasks import verify_accounts_connectivity_task, push_accounts_to_assets_task
 | 
			
		||||
from assets.exceptions import NotSupportedTemporarilyError
 | 
			
		||||
 | 
			
		||||
__all__ = [
 | 
			
		||||
    'AccountsTaskCreateAPI',
 | 
			
		||||
| 
						 | 
				
			
			@ -28,6 +29,11 @@ class AccountsTaskCreateAPI(CreateAPIView):
 | 
			
		|||
        if data['action'] == 'push':
 | 
			
		||||
            task = push_accounts_to_assets_task.delay(account_ids)
 | 
			
		||||
        else:
 | 
			
		||||
            account = accounts[0]
 | 
			
		||||
            asset = account.asset
 | 
			
		||||
            if not asset.auto_info['ansible_enabled'] or \
 | 
			
		||||
                not asset.auto_info['ping_enabled']:
 | 
			
		||||
                raise NotSupportedTemporarilyError()
 | 
			
		||||
            task = verify_accounts_connectivity_task.delay(account_ids)
 | 
			
		||||
 | 
			
		||||
        data = getattr(serializer, '_data', {})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,12 +8,10 @@ from rest_framework.response import Response
 | 
			
		|||
 | 
			
		||||
from accounts.tasks import push_accounts_to_assets_task, verify_accounts_connectivity_task
 | 
			
		||||
from assets import serializers
 | 
			
		||||
from assets.exceptions import NotSupportedTemporarilyError
 | 
			
		||||
from assets.filters import IpInFilterBackend, LabelFilterBackend, NodeFilterBackend
 | 
			
		||||
from assets.models import Asset, Gateway
 | 
			
		||||
from assets.tasks import (
 | 
			
		||||
    test_assets_connectivity_manual,
 | 
			
		||||
    update_assets_hardware_info_manual
 | 
			
		||||
)
 | 
			
		||||
from assets.tasks import test_assets_connectivity_manual, update_assets_hardware_info_manual
 | 
			
		||||
from common.api import SuggestionMixin
 | 
			
		||||
from common.drf.filters import BaseFilterSet
 | 
			
		||||
from common.utils import get_logger, is_uuid
 | 
			
		||||
| 
						 | 
				
			
			@ -154,6 +152,10 @@ class AssetsTaskMixin:
 | 
			
		|||
        if data["action"] == "refresh":
 | 
			
		||||
            task = update_assets_hardware_info_manual(assets)
 | 
			
		||||
        else:
 | 
			
		||||
            asset = assets[0]
 | 
			
		||||
            if not asset.auto_info['ansible_enabled'] or \
 | 
			
		||||
                not asset.auto_info['ping_enabled']:
 | 
			
		||||
                raise NotSupportedTemporarilyError()
 | 
			
		||||
            task = test_assets_connectivity_manual(assets)
 | 
			
		||||
        return task
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,12 @@
 | 
			
		|||
from django.utils.translation import ugettext_lazy as _
 | 
			
		||||
from rest_framework import status
 | 
			
		||||
 | 
			
		||||
from common.exceptions import JMSException
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class NodeIsBeingUpdatedByOthers(JMSException):
 | 
			
		||||
    status_code = status.HTTP_409_CONFLICT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class NotSupportedTemporarilyError(JMSException):
 | 
			
		||||
    default_detail = _("This function is not supported temporarily")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,3 @@
 | 
			
		|||
version https://git-lfs.github.com/spec/v1
 | 
			
		||||
oid sha256:331188bb5169bb463da018a635589e12a2136d476db264ac7e5d6e5d63ca474a
 | 
			
		||||
size 135916
 | 
			
		||||
oid sha256:af57d16430705feb02ebbb99fc3a2f5fc3bab69209f558aa4d69b1e8055a6f5f
 | 
			
		||||
size 136036
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ msgid ""
 | 
			
		|||
msgstr ""
 | 
			
		||||
"Project-Id-Version: PACKAGE VERSION\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: \n"
 | 
			
		||||
"POT-Creation-Date: 2023-02-21 18:29+0800\n"
 | 
			
		||||
"POT-Creation-Date: 2023-02-21 22:44+0800\n"
 | 
			
		||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 | 
			
		||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 | 
			
		||||
"Language-Team: LANGUAGE <LL@li.org>\n"
 | 
			
		||||
| 
						 | 
				
			
			@ -908,7 +908,7 @@ msgstr "アプリケーション"
 | 
			
		|||
msgid "Can match application"
 | 
			
		||||
msgstr "アプリケーションを一致させることができます"
 | 
			
		||||
 | 
			
		||||
#: assets/api/asset/asset.py:144
 | 
			
		||||
#: assets/api/asset/asset.py:142
 | 
			
		||||
msgid "Cannot create asset directly, you should create a host or other"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"資産を直接作成することはできません。ホストまたはその他を作成する必要がありま"
 | 
			
		||||
| 
						 | 
				
			
			@ -1051,6 +1051,10 @@ msgstr "基本"
 | 
			
		|||
msgid "Script"
 | 
			
		||||
msgstr "脚本"
 | 
			
		||||
 | 
			
		||||
#: assets/exceptions.py:12
 | 
			
		||||
msgid "This function is not supported temporarily"
 | 
			
		||||
msgstr "この機能は一時的にサポートされていません"
 | 
			
		||||
 | 
			
		||||
#: assets/models/_user.py:25
 | 
			
		||||
msgid "SSH private key"
 | 
			
		||||
msgstr "SSH秘密鍵"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,3 @@
 | 
			
		|||
version https://git-lfs.github.com/spec/v1
 | 
			
		||||
oid sha256:2cdc2b875c98f41bd698833a989195d8cc4245f39f52b7eab41ad4d95075cb17
 | 
			
		||||
size 111666
 | 
			
		||||
oid sha256:3b6ee4a378810f2515be5020e3fa0b1297e1c207260ca60bb14dc5407ca19c43
 | 
			
		||||
size 111750
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ msgid ""
 | 
			
		|||
msgstr ""
 | 
			
		||||
"Project-Id-Version: JumpServer 0.3.3\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: \n"
 | 
			
		||||
"POT-Creation-Date: 2023-02-21 18:29+0800\n"
 | 
			
		||||
"POT-Creation-Date: 2023-02-21 22:44+0800\n"
 | 
			
		||||
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
 | 
			
		||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
 | 
			
		||||
"Language-Team: JumpServer team<ibuler@qq.com>\n"
 | 
			
		||||
| 
						 | 
				
			
			@ -902,7 +902,7 @@ msgstr "应用程序"
 | 
			
		|||
msgid "Can match application"
 | 
			
		||||
msgstr "匹配应用"
 | 
			
		||||
 | 
			
		||||
#: assets/api/asset/asset.py:144
 | 
			
		||||
#: assets/api/asset/asset.py:142
 | 
			
		||||
msgid "Cannot create asset directly, you should create a host or other"
 | 
			
		||||
msgstr "不能直接创建资产, 你应该创建主机或其他资产"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1043,6 +1043,10 @@ msgstr "基本"
 | 
			
		|||
msgid "Script"
 | 
			
		||||
msgstr "脚本"
 | 
			
		||||
 | 
			
		||||
#: assets/exceptions.py:12
 | 
			
		||||
msgid "This function is not supported temporarily"
 | 
			
		||||
msgstr "暂时不支持此功能"
 | 
			
		||||
 | 
			
		||||
#: assets/models/_user.py:25
 | 
			
		||||
msgid "SSH private key"
 | 
			
		||||
msgstr "SSH密钥"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue