No Graceful Degradation for Missing Tools #19

Open
opened 2026-02-02 14:50:56 -05:00 by jared · 0 comments
Owner

If smartctl, nvme, ceph, or pct commands are missing, the script fails loudly. It should report to run this script to install them (curl -s http://10.10.10.63:3000/LotusGuild/freshStartScript/raw/branch/main/freshStart.sh | bash)

Add tool detection:

def _check_tool_availability(self):
"""Check if required tools are available."""
required_tools = {
'smartctl': 'smartmontools',
'lsblk': 'util-linux',
}
optional_tools = {
'nvme': 'nvme-cli',
'ceph': 'ceph-common',
'pct': 'proxmox-ve',
}

missing_required = []
for tool, package in required_tools.items():
    if not shutil.which(tool):
        missing_required.append(f"{tool} (install {package})")

if missing_required:
    raise RuntimeError(f"Missing required tools: {', '.join(missing_required)}")

for tool in optional_tools:
    if not shutil.which(tool):
        logger.info(f"Optional tool {tool} not found - some features disabled")
If smartctl, nvme, ceph, or pct commands are missing, the script fails loudly. It should report to run this script to install them (curl -s http://10.10.10.63:3000/LotusGuild/freshStartScript/raw/branch/main/freshStart.sh | bash) Add tool detection: def _check_tool_availability(self): """Check if required tools are available.""" required_tools = { 'smartctl': 'smartmontools', 'lsblk': 'util-linux', } optional_tools = { 'nvme': 'nvme-cli', 'ceph': 'ceph-common', 'pct': 'proxmox-ve', } missing_required = [] for tool, package in required_tools.items(): if not shutil.which(tool): missing_required.append(f"{tool} (install {package})") if missing_required: raise RuntimeError(f"Missing required tools: {', '.join(missing_required)}") for tool in optional_tools: if not shutil.which(tool): logger.info(f"Optional tool {tool} not found - some features disabled")
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/hwmonDaemon#19