jumpserver/apps/assets/automations/ping/manager.py

21 lines
586 B
Python
Raw Normal View History

2022-10-27 10:53:10 +00:00
from common.utils import get_logger
from assets.const import AutomationTypes
2022-10-12 10:08:57 +00:00
from ..base.manager import BasePlaybookManager
2022-10-27 10:53:10 +00:00
logger = get_logger(__name__)
2022-10-12 10:08:57 +00:00
2022-10-27 10:53:10 +00:00
class PingManager(BasePlaybookManager):
2022-10-28 10:28:41 +00:00
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.host_asset_mapper = {}
@classmethod
def method_type(cls):
return AutomationTypes.ping
def host_callback(self, host, asset=None, **kwargs):
super().host_callback(host, asset=asset, **kwargs)
self.host_asset_mapper[host['name']] = asset
return host