jumpserver/apps/assets/automations/endpoint.py

21 lines
552 B
Python
Raw Normal View History

2022-10-09 12:54:11 +00:00
# from .backup.manager import AccountBackupExecutionManager
#
#
2022-10-13 09:47:29 +00:00
from .change_secret.manager import ChangeSecretManager
2022-10-17 03:22:21 +00:00
from .gather_facts.manager import GatherFactsManager
2022-10-10 05:56:42 +00:00
2022-10-09 12:54:11 +00:00
class ExecutionManager:
2022-10-10 05:56:42 +00:00
manager_type_mapper = {
2022-10-13 09:47:29 +00:00
'change_secret': ChangeSecretManager,
2022-10-17 03:22:21 +00:00
'gather_facts': GatherFactsManager,
2022-10-09 12:54:11 +00:00
}
2022-10-10 05:56:42 +00:00
def __init__(self, execution):
self.execution = execution
self._runner = self.manager_type_mapper[execution.automation.type](execution)
def run(self, **kwargs):
return self._runner.run(**kwargs)