source: ogClient-Git/src/utils/disk.py @ 81ee4b0

Last change on this file since 81ee4b0 was 902e019, checked in by Jose M. Guisado <jguisado@…>, 3 years ago

Add utils modules

  • disk.py

Disk discovery

  • fs.py

Uses psutil to fetch fs usage information

  • menu.py

ogBrowser menu generation

  • net.py: gets nic status information

IP address, MAC address and ethernet speed.

  • probe.py: probes mountpoints for operating systems

Uses hivexget command to try fetching Windows installation
information.
Looks for /etc/os-release for probing linux systems.

  • Property mode set to 100644
File size: 634 bytes
Line 
1#
2# Copyright (C) 2022 Soleta Networks <info@soleta.eu>
3#
4# This program is free software: you can redistribute it and/or modify it under
5# the terms of the GNU Affero General Public License as published by the
6# Free Software Foundation; either version 3 of the License, or
7# (at your option) any later version.
8
9import os
10
11def get_disks():
12    """
13    Walks /sys/block/ and returns files starting with 'sd',
14    'nvme' or 'vd'
15    """
16    return sorted([ dev for dev in os.listdir('/sys/block/')
17                    if dev.startswith('sd')
18                    or dev.startswith('nvme')
19                    or dev.startswith('vd')])
Note: See TracBrowser for help on using the repository browser.