Merge pull request #3789 from jumpserver/dev_bai

[Update] 修改执行task时切换root组织
pull/3791/head
BaiJiangJie 2020-03-18 13:49:04 +08:00 committed by GitHub
commit 250acea751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,8 @@ def run_ansible_task(tid, callback=None, **kwargs):
:param callback: callback function name
:return:
"""
task = get_object_or_none(Task, id=tid)
with tmp_to_root_org():
task = get_object_or_none(Task, id=tid)
if task:
result = task.run()
if callback is not None: