RETIRED, further work has moved to Debian project infrastructure
Go to file
Jarrod Johnson 3f4185fa60 Add script to help build rpms
setup.py bdist_rpm is not very good.
Instead, provide a script to create an rpm.

Change-Id: If6773ee4938e981a14c38e4e4eabad6b5cb2b6ae
2016-10-11 11:08:06 -04:00
bin Add support for OEM command for IPv6 address fetch 2016-03-21 16:20:58 -04:00
doc/source Remove unused pngmath Sphinx extension 2016-05-10 13:56:06 +00:00
pyghmi Extend FPC status 2016-10-04 10:18:20 -04:00
.gitignore Align to OpenStack Build Standards. 2013-06-30 14:21:20 -04:00
.gitreview Update .gitreview for new namespace 2015-10-17 22:36:04 +00:00
.testr.conf Align to OpenStack Build Standards. 2013-06-30 14:21:20 -04:00
LICENSE Place project under Apache license 2.0 2013-06-24 14:15:39 -04:00
MANIFEST.in Align to OpenStack Build Standards. 2013-06-30 14:21:20 -04:00
README Install scripts as well as library 2014-05-08 14:06:01 -04:00
README.md Add a new README 2016-03-21 15:04:26 -04:00
buildrpm Add script to help build rpms 2016-10-11 11:08:06 -04:00
python-pyghmi.spec Add script to help build rpms 2016-10-11 11:08:06 -04:00
requirements.txt Remove libvirt from requirements 2015-06-03 14:37:31 -04:00
setup.cfg Point to more specific page for pyghmi 2015-12-01 13:18:53 -05:00
setup.py Add license parameter to setup.py 2015-12-01 14:30:01 -05:00
test-requirements.txt Update from requirements 2013-09-13 11:28:28 -05:00
tox.ini Remove support for py33/py26 2016-03-23 02:45:52 +00:00

README.md

pyghmi

Pyghmi is a pure Python (mostly IPMI) server management library.

Building and installing

(These instructions have been tested on CentOS 7)

Clone the repository, generate the RPM and install it:

$ git clone https://github.com/openstack/pyghmi.git
$ cd pyghmi/
$ python setup.py bdist_rpm
$ sudo rpm -ivh dist/pyghmi-*.noarch.rpm

Using

There are a few use examples in the bin folder:

  • fakebmc: simply fakes a BMC that supports a few IPMI commands (useful for testing)
  • pyghmicons: a remote console based on SOL redirection over IPMI
  • pyghmiutil: an IPMI client that supports a few direct uses of pyghmi (also useful for testing and prototyping new features)
  • virshbmc: a BMC emulation wrapper using libvirt

Extending

If you plan on adding support for new features, you'll most likely be interested in adding your methods to pyghmi/ipmi/command.py. See methods such as get_users and set_power for examples of how to use internal mechanisms to implement new features. And please, always document new methods.

Sometimes you may want to implement OEM-specific code. For example, retrieving firmware version information is not a part of standard IPMI, but some servers are known to support it via custom OEM commands. If this is the case, follow these steps:

  • Add your generic retrieval function (stub) to the OEMHandler class in
  • pyghmi/ipmi/oem/generic.py. And please, document its intent, parameters and
  • expected return values.
  • Implement the specific methods that your server supports in subdirectories in
  • the oem folder (consider the lenovo submodule as an example). A OEM folder
  • will contain at least one class inheriting from OEMHandler, and optionally
  • helpers for running and parsing custom OEM commands.
  • Register mapping policies in pyghmi/ipmi/oem/lookup.py so pyghmi knows how
  • to associate a BMC session with the specific OEM code you implemented.

A good way of testing the new feature is using bin/pyghmiutil. Just add an extension for the new feature you just implemented (as a new command) and call it from the command line:

$ IPMIPASSWORD=passw0rd bin/pyghmiutil [BMC IP address] username my_new_feature_command