hille721 / python-dmmp

Python API of multipath-tools(device-mapper-multipath)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-dmmp

Python(2 & 3) API of multipath-tools in LGPL 3.0+ license.

Install

python setup.py install

Usage

Sample code, for detailed usage, check help(dmmp):

import dmmp

for mpath in dmmp.mpaths_get():
    print("Got mpath: wwid '%s', name '%s'" % (mpath.wwid, mpath.name))
    for pg in mpath.path_groups:
        print("\tGot path group: id '%d', priority '%d', status '%d(%s)', "
              "selector '%s'" %
              (pg.id, pg.priority, pg.status, pg.status_string, pg.selector))

        for p in pg.paths:
            print("\t\tGot path: blk_name '%s', status '%d(%s)'" %
                  (p.blk_name, p.status, p.status_string))

Contact

About

Python API of multipath-tools(device-mapper-multipath)

License:GNU Lesser General Public License v3.0


Languages

Language:Python 100.0%