fix(ops): 修复task run as的问题

This commit is contained in:
ibuler
2020-11-16 18:15:30 +08:00
committed by Jiangjie.Bai
parent 0db72bd00f
commit 83099dcd16

View File

@@ -110,7 +110,7 @@ class JMSInventory(JMSBaseInventory):
try:
asset = self.assets.get(id=host.get('id'))
manager = AssetUserManager()
run_user = manager.get_latest(username=self.run_as, asset=asset)
run_user = manager.get_latest(username=self.run_as, asset=asset, prefer='system_user')
except Exception as e:
logger.error(e, exc_info=True)
return {}