# Path: canaryd/subprocess.py
# def ensure_command_tuple(command):
# def decode_output(output):
# def get_command_output(command, *args, **kwargs):


import sys
from canaryd.subprocess import CalledProcessError, get_command_output
    6: True,  # error log
    7: True,  # self-test errors
}


try:
    # Ensure smartctl is present & working
    get_command_output(
        'smartctl --version',
    )

except (CalledProcessError, OSError):
    print('No smartctl found!')
    sys.exit(1)


try:
    # Look for OSX disks first (OSX has /dev/sdt which breaks below)
    disks_data = get_command_output(
        'ls /dev/disk?',
        shell=True,
    )

except (CalledProcessError, OSError):
    try:
        # Look for Linux disks (/dev/sdX, /dev/hdX, /dev/nvmeX)
        disks_data = get_command_output(
            'ls /dev/[hs]d? || ls /dev/nvme?',
            shell=True,
        )

# Path: canaryd/subprocess.py
# def ensure_command_tuple(command):
# def decode_output(output):
# def get_command_output(command, *args, **kwargs):


# Path: canaryd/scripts/disk_health.py
import sys
from canaryd.subprocess import CalledProcessError, get_command_output

    6: True,  # error log
    7: True,  # self-test errors
}


try:
    # Ensure smartctl is present & working
    get_command_output(
        'smartctl --version',
    )

except (CalledProcessError, OSError):
    print('No smartctl found!')
    sys.exit(1)


try:
    # Look for OSX disks first (OSX has /dev/sdt which breaks below)
    disks_data = get_command_output(
        'ls /dev/disk?',
        shell=True,
    )

except (CalledProcessError, OSError):
    try:
        # Look for Linux disks (/dev/sdX, /dev/hdX, /dev/nvmeX)
        disks_data = get_command_output(
            'ls /dev/[hs]d? || ls /dev/nvme?',
            shell=True,
        )

    except (CalledProcessError, OSError):