amarao / sdled

Control fault/locate indicators in disk slots in enclosures (SES devices)
GNU General Public License v2.0
49 stars 20 forks source link

encled improvements #2

Closed alanwevans closed 8 years ago

alanwevans commented 8 years ago

My enclosure does not use the Slot XX naming. From what I can see this is set by the manufacturer in firmware and is not fixed.

Also I made the script more reusable by making a main() function and using the name == 'main' methodology. This way someone can borrow from the code or you can use python from the shell and import from the script without having things execute immediately. I used this technique for debugging actually.

$ mv encled encled.py $ python from encled import * list_enc() list_slots()

Finding this script saved me a bunch of time writing my own!

Thanks, -Alan

amarao commented 8 years ago

Good job!

Thank you. I think, I should rewrite it a bit more like a library for enclosures, not a standalone binary.