-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve disk report util and set it specific to Linux machines
- Loading branch information
1 parent
9c16d1b
commit f0386d7
Showing
7 changed files
with
35 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import os | ||
import logging | ||
|
||
from fastapi.responses import HTMLResponse | ||
|
||
LOGGER = logging.getLogger("uvicorn.default") | ||
|
||
def report(): | ||
"""Generated disk utility report and returns an HTMLResponse.""" | ||
try: | ||
import pyudisk | ||
|
||
report_file = os.path.join(os.getcwd(), "disk-report.html") | ||
return HTMLResponse( | ||
content=pyudisk.generate_report(filepath=report_file, raw=True) | ||
) | ||
except Exception: | ||
return None | ||
async def report() -> HTMLResponse: | ||
"""Generates a disk report using pyudisk. | ||
Returns: | ||
HTMLResponse: | ||
Returns an HTML response with the disk report. | ||
""" | ||
import pyudisk | ||
|
||
return HTMLResponse(content=pyudisk.generate_report(raw=True)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters