perf: 优化获取当前 python 执行路径的方式

pull/12123/head
Aaron3S 2023-11-14 19:31:59 +08:00 committed by Eric_Lee
parent b15c314384
commit 7610f64433
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import json import json
import logging import logging
import os import os
import sys
import uuid import uuid
from collections import defaultdict from collections import defaultdict
from datetime import timedelta from datetime import timedelta
@ -77,7 +78,7 @@ class JMSPermedInventory(JMSInventory):
host['login_user'] = account.username host['login_user'] = account.username
host['login_password'] = account.secret host['login_password'] = account.secret
host['login_db'] = asset.spec_info.get('db_name', '') host['login_db'] = asset.spec_info.get('db_name', '')
host['ansible_python_interpreter'] = '/opt/py3/bin/python' host['ansible_python_interpreter'] = sys.executable
return host return host
return super().make_account_vars(host, asset, account, automation, protocol, platform, gateway) return super().make_account_vars(host, asset, account, automation, protocol, platform, gateway)