flux.hostlist module

class flux.hostlist.Hostlist(arg='', handle=None)

Bases: flux.wrapper.WrapperPimpl

A Flux hostlist object

The Hostlist class wraps libflux-hostlist to implement a list of hosts which can be converted to and from the RFC 29 hostlist encoding.

class InnerWrapper(handle=None)

Bases: flux.wrapper.Wrapper

append(*args)

Append one or more arguments to a Hostlist

Args may be either a Hostlist or any valid argument to Hostlist()

copy()

Copy a Hostlist object

count()

Return the number of hosts in Hostlist

delete(hosts)

Delete host or hosts from Hostlist

param: hosts: A Hostlist or string in RFC 29 hostlist encoding

encode()

Encode a Hostlist to an RFC 29 hostlist string

expand()

Convert a Hostlist to a Python list

sort()

Sort a Hostlist

uniq()

Sort and remove duplicate hostnames from Hostlist

class flux.hostlist.HostlistIterator(hostlist)

Bases: object

flux.hostlist.decode(arg)

Decode a string or iterable of strings in RFC 29 hostlist format to a Hostlist object