[Update] 修改执行task时切换root组织

pull/3789/head
Bai 2020-03-18 13:45:49 +08:00
parent ffce909ee3
commit 00d9f71384
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: