mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 08:19:04 +00:00
perf: change secret automation
This commit is contained in:
@@ -3,18 +3,19 @@
|
||||
#
|
||||
from .change_secret.manager import ChangeSecretManager
|
||||
from .gather_facts.manager import GatherFactsManager
|
||||
from ..const import AutomationTypes
|
||||
|
||||
|
||||
class ExecutionManager:
|
||||
manager_type_mapper = {
|
||||
'change_secret': ChangeSecretManager,
|
||||
'gather_facts': GatherFactsManager,
|
||||
AutomationTypes.change_secret: ChangeSecretManager,
|
||||
AutomationTypes.gather_facts: GatherFactsManager,
|
||||
}
|
||||
|
||||
def __init__(self, execution):
|
||||
self.execution = execution
|
||||
self._runner = self.manager_type_mapper[execution.automation.type](execution)
|
||||
self._runner = self.manager_type_mapper[execution.manager_type](execution)
|
||||
|
||||
def run(self, **kwargs):
|
||||
return self._runner.run(**kwargs)
|
||||
def run(self, *args, **kwargs):
|
||||
return self._runner.run(*args, **kwargs)
|
||||
|
||||
|
Reference in New Issue
Block a user