mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-16 23:38:36 +00:00
批量命令支持更广泛的设备如思科等网络设备,docker等 (#6356)
* feat: Update README (#6182) * feat: Update README * feat: Update README * Update README.md * feat: update README * Update README.md * docs: 修改英文版本 * Update README.md * 批量命令支持更广泛的设备如思科等网络设备,docker等 Co-authored-by: Jiangjie.Bai <32935519+BaiJiangJie@users.noreply.github.com> Co-authored-by: 老广 <ibuler@qq.com>
This commit is contained in:
@@ -250,7 +250,7 @@ class CommandRunner(AdHocRunner):
|
||||
results_callback_class = CommandResultCallback
|
||||
modules_choices = ('shell', 'raw', 'command', 'script', 'win_shell')
|
||||
|
||||
def execute(self, cmd, pattern, module='shell'):
|
||||
def execute(self, cmd, pattern, module='raw'):
|
||||
if module and module not in self.modules_choices:
|
||||
raise AnsibleError("Module should in {}".format(self.modules_choices))
|
||||
|
||||
|
@@ -87,7 +87,7 @@ class CommandExecution(OrgModelMixin):
|
||||
if host and host.is_windows():
|
||||
shell = 'win_shell'
|
||||
else:
|
||||
shell = 'shell'
|
||||
shell = 'raw'
|
||||
result = runner.execute(self.command, 'all', module=shell)
|
||||
self.result = result.results_command
|
||||
except SoftTimeLimitExceeded as e:
|
||||
|
Reference in New Issue
Block a user