2023-01-18 09:14:02 +00:00
|
|
|
from accounts.const import AutomationTypes
|
|
|
|
from assets.automations.ping_gateway.manager import PingGatewayManager
|
2023-03-08 10:52:00 +00:00
|
|
|
from common.utils import get_logger
|
2023-01-18 09:14:02 +00:00
|
|
|
|
|
|
|
logger = get_logger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class VerifyGatewayAccountManager(PingGatewayManager):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def method_type(cls):
|
|
|
|
return AutomationTypes.verify_gateway_account
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def before_runner_start():
|
|
|
|
logger.info(">>> 开始执行测试网关账号可连接性任务")
|
|
|
|
|
|
|
|
def get_accounts(self, gateway):
|
2023-03-08 10:52:00 +00:00
|
|
|
account_ids = self.execution.snapshot['accounts']
|
|
|
|
accounts = gateway.accounts.filter(id__in=account_ids)
|
2023-01-18 09:14:02 +00:00
|
|
|
return accounts
|