Skip to content

Instantly share code, notes, and snippets.

@dwlehman
dwlehman / lsm-hba.py
Last active December 14, 2016 20:30
example code using libstoragemgmt to gather HBA RAID info
from collections import namedtuple
import lsm
_hba_plugin_uris = ("hpsa://", "megaraid://")
HBAVolumeInfo = namedtuple('HBAVolumeInfo', ['system', 'nodes', 'raid_type', 'raid_stripe_size'])
""" lighweight data structure containing HBA RAID info:
system (str): descriptive name of HBA unit
nodes (list of str): list of device node paths for the volume
@dwlehman
dwlehman / pep8names.py
Last active October 29, 2015 13:40
Quick & dirty solution to converting an entire python package/module to use pep8 naming.
# pep8names.py
#
# Convert all python files in a directory to use pep8 naming conventions.
#
# The conversion is done in-place.
#
# Warning: this will also convert names from external packages/modules,
# including the standard library, so you will want to check the
# results.
#