change module names

This commit is contained in:
wh1te909 2020-03-01 12:20:36 +00:00
parent 1b56982e22
commit 8594332784
3 changed files with 7 additions and 12 deletions

View File

@ -1,11 +0,0 @@
from __future__ import absolute_import
import psutil
def get_services():
try:
svc = [x.as_dict() for x in psutil.win_service_iter()]
except Exception:
svc = {"error": "error getting services"}
finally:
return svc

View File

@ -1,6 +1,12 @@
from __future__ import absolute_import
import psutil
import os
def get_services():
return [svc.as_dict() for svc in psutil.win_service_iter()]
def run_python_script(filename, timeout):
python_bin = os.path.join("c:\\salt\\bin", "python.exe")
file_path = os.path.join("c:\\windows\\temp", filename)

View File

@ -29,7 +29,7 @@ def get_refreshed_services(request, pk):
agent = get_object_or_404(Agent, pk=pk)
try:
resp = agent.salt_api_cmd(
hostname=agent.salt_id, timeout=30, func="get_services.get_services"
hostname=agent.salt_id, timeout=30, func="win_agent.get_services"
)
data = resp.json()
except Exception: