Skip to content

hochshi/pymodule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pymodule

Provide a python interface to RHEL module. Two functions are provided:

  • list - List loaded modules
  • __call__ - will run module with the given args as a list of strings or multiple string arguments

Usage

    from pymodule import pymodule
    module = pymodule.PyModule()
    # List loaded modules:
    module.list()
    # Load modules
    module('load', 'bash')
    module(['load','bash'])
    # The entire set of commands are supported via __call__
    # as example
    module('purge')

Configuration

Please override the following defaults with your system specific ones before creating a PyModule instance, the defaults are shown in parentheses

  • MODULE_VERSION ('3.2.10') - used to set the version
  • MODULESHOME ('/apps/RH7U2/Modules/%s' % MODULE_VERSION) - used as base path to bin/modulecmd and to init/.modulespath
  • MODULE_RE ('\d+)\s+([\w/.]+)') - used to parse module list output and return match 'module/version' i.e. git/2.11.0

About

Provide a python interface to RHEL module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages