python-hostlist 1.14

Python module for hostlist handling

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!

What's new in python-hostlist 1.4:

  • Support Python 3.
  • Import reduce from functools if possible.
  • Use Python 2/3 installation trick from .../Demo/distutils/test2to3
Read full changelog
send us
an update
LICENSE TYPE:
GPL (GNU General Public License) 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Kent Engström
HOMEPAGE:
www.nsc.liu.se
CATEGORY:
ROOT \ System \ Clustering and Distributed Networks
python-hostlist is a Python module that knows how to expand and collect hostlist expressions.

Example:

  % python
  Python 2.5.1 (r251:54863, Jul 10 2008, 17:24:48)
  [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import hostlist
  >>> hosts = hostlist.expand_hostlist("n[1-10,17]")
  >>> hosts
  ['n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n17']
  >>> hostlist.collect_hostlist(hosts)
  'n[1-10,17]'
  >>> hostlist.collect_hostlist(["x1y1","x2y2", "x1y2", "x2y1"])
  'x[1-2]y[1-2]'


Bad hostlists or hostnames will result in the hostlist.BadHostlist exception being raised.

The 'hostlist' command is provided to expand/collect hostlists and perform set operations on them. Example:

  % hostlist n[1-10] n[5-20]
  n[1-20]
  % hostlist --difference n[1-10] n[5-20]
  n[1-4]
  % hostlist --expand --intersection n[1-10] n[5-20]
  n5
  n6
  n7
  n8
  n9
  n10


Install directly by running

  python setup.py build   (as yourself)
  python setup.py install (as root)


or just copy the hostlist.py, hostlist and hostlist.1 files to appropriate places.

Last updated on July 11th, 2012

requirements

#expand hostlist expressions #collect hostlist expressions #Python library #Python #hostlist #expressions #library

Add your review!

SUBMIT