Cluster nodes utility module

The NodeUtils module is a ClusterShell helper module that provides supplementary services to manage nodes in a cluster. It is primarily designed to enhance the NodeSet module providing some binding support to external node groups sources in separate namespaces (example of group sources are: files, jobs scheduler, custom scripts, etc.).

class ClusterShell.NodeUtils.GroupSource(name, groups=None, allgroups=None)

ClusterShell Group Source class.

A Group Source object defines resolv_map, resolv_list, resolv_all and optional resolv_reverse methods for node group resolution. It is constituting a group resolution namespace.

__init__(name, groups=None, allgroups=None)

Initialize GroupSource

  • name -- group source name
  • groups -- group to nodes dict
  • allgroups -- optional "all groups" result (string)

list of weak references to the object (if defined)


Return the content of all groups as defined by this GroupSource


Return a list of all group names for this group source


Get nodes from group group


Return the group name matching the provided node.

class ClusterShell.NodeUtils.GroupResolver(default_source=None, illegal_chars=None)

Base class GroupResolver that aims to provide node/group resolution from multiple GroupSources.

A GroupResolver object might be initialized with a default GroupSource object, that is later used when group resolution is requested with no source information. As of version 1.7, a set of illegal group characters may also be provided for sanity check (raising GroupResolverIllegalCharError when found).

__init__(default_source=None, illegal_chars=None)

Lazy initialization of a new GroupResolver object.


list of weak references to the object (if defined)


Add a GroupSource to this resolver.


Find all nodes. You may specify an optional namespace.


Get default source name of resolver.

group_nodes(group, namespace=None)

Find nodes for specified group name and optional namespace.


Get full group list. You may specify an optional namespace.


Return whether finding group list for a specified node is supported by the resolver (in optional namespace).

node_groups(node, namespace=None)

Find group list for specified node and optional namespace.


Set debugging verbosity value (DEPRECATED: use logging.DEBUG).


Get the list of all resolver source names.

class ClusterShell.NodeUtils.GroupResolverConfig(filenames, illegal_chars=None)

GroupResolver class that is able to automatically setup its GroupSource's from a configuration file. This is the default resolver for NodeSet.

__init__(filenames, illegal_chars=None)

Lazy init GroupResolverConfig object from filenames.