Skip to content

Commit

Permalink
Release v0.0.3
Browse files Browse the repository at this point in the history
Replace `disk_lib` with the name `udisk_lib`
  • Loading branch information
dormant-user committed Nov 26, 2024
1 parent b7fcc6e commit de7b309
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pyudisk start
> _By default, `PyUdisk` will look for a `.env` file in the current working directory._
</details>
- **DISK_LIB**: Path to the `udisksctl` command-line tool. Default: `/usr/bin/udisksctl`
- **UDISK_LIB**: Path to the `udisksctl` command-line tool. Default: `/usr/bin/udisksctl`
- **METRICS**: List of metrics to monitor. Default: `[]`
- **GMAIL_USER**: Gmail username to authenticate SMTP library.
- **GMAIL_PASS**: Gmail password to authenticate SMTP library.
Expand Down
4 changes: 2 additions & 2 deletions pyudisk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import click

from .main import generate_report, monitor
from .main import generate_report, monitor, smart_metrics # noqa: F401

version = "0.0.2"
version = "0.0.3"


@click.command()
Expand Down
6 changes: 3 additions & 3 deletions pyudisk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class EnvConfig(BaseSettings):
sample_partitions: str = "partitions.json"
sample_dump: str = "dump.txt"

disk_lib: FilePath = "/usr/bin/udisksctl"
udisk_lib: FilePath = "/usr/bin/udisksctl"
metrics: Metric | List[Metric] = Field(default_factory=list)

# Email/SMS notifications
Expand All @@ -72,8 +72,8 @@ class EnvConfig(BaseSettings):
report_file: str = Field("disk_report_%m-%d-%Y_%I:%M_%p.html", pattern=r".*\.html$")

# noinspection PyMethodParameters
@field_validator("disk_lib", mode="before")
def validate_disk_lib(cls, value: str) -> str:
@field_validator("udisk_lib", mode="before")
def validate_udisk_lib(cls, value: str) -> str:
"""Validates the disk library path only when DRY_RUN is set to false."""
if os.environ.get("DRY_RUN", "false") == "true":
return __file__
Expand Down
2 changes: 1 addition & 1 deletion pyudisk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_smart_metrics(env: EnvConfig) -> str:
text = load_dump(filename=env.sample_dump)
else:
try:
output = subprocess.check_output(f"{env.disk_lib} dump", shell=True)
output = subprocess.check_output(f"{env.udisk_lib} dump", shell=True)
except subprocess.CalledProcessError as error:
LOGGER.error(error)
return ""
Expand Down

0 comments on commit de7b309

Please sign in to comment.