mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 02:39:45 +00:00
No need to find the mountpoint first for disk usage.
This commit is contained in:
parent
6f1feed265
commit
a8aeb63c91
@ -24,7 +24,7 @@ from gns3server.schemas.version import VERSION_SCHEMA
|
||||
from gns3server.schemas.server_statistics import SERVER_STATISTICS_SCHEMA
|
||||
from gns3server.compute.port_manager import PortManager
|
||||
from gns3server.utils.cpu_percent import CpuPercent
|
||||
from gns3server.utils.path import get_default_project_directory, get_mountpoint
|
||||
from gns3server.utils.path import get_default_project_directory
|
||||
from gns3server.version import __version__
|
||||
from aiohttp.web import HTTPConflict
|
||||
|
||||
@ -62,8 +62,7 @@ class ServerHandler:
|
||||
load_average_percent = [int(x / psutil.cpu_count() * 100) for x in psutil.getloadavg()]
|
||||
memory_percent = int(psutil.virtual_memory().percent)
|
||||
swap_percent = int(psutil.swap_memory().percent)
|
||||
project_dir_mountpoint = get_mountpoint(get_default_project_directory())
|
||||
disk_usage_percent = int(psutil.disk_usage(project_dir_mountpoint).percent)
|
||||
disk_usage_percent = int(psutil.disk_usage(get_default_project_directory()).percent)
|
||||
except psutil.Error as e:
|
||||
raise HTTPConflict(text="Psutil error detected: {}".format(e))
|
||||
response.json({"memory_total": memory_total,
|
||||
|
Loading…
Reference in New Issue
Block a user