Command Arguments and Base Configuration

pavilion.arguments module

Sets up a base set of pavilion arguments, and allows plugins and other components to add sub-commands.

pavilion.arguments.get_parser()

Get the main pavilion argument parser. This is generally only meant to be used by the main pavilion command. If the main parser hasn’t yet been defined, this defines it.

pavilion.arguments.get_subparser()

Get the pavilion subparser object. This should be used by command plugins to add sub-commands and their arguments to Pavilion. (If you’re writing a command, use the _setup_arguments method on automatically provided sub-command parser.)

See https://docs.python.org/3/library/argparse.html#sub-commands

Return type:argparse._SubParsersAction
pavilion.arguments.reset_parser()

Reset back to the base parser. This is for unittests only.

pavilion.config module

This module defines the base configuration for Pavilion itself.

class pavilion.config.PavilionConfigLoader

Bases: yaml_config.loaders.YamlConfigLoader

This object uses YamlConfig to define Pavilion’s base configuration format and options. If you’re looking to add an option to the general pavilion.yaml format, this is the place to do it.

ELEMENTS = [<yaml_config ListElem config_dirs>, <yaml_config BoolElem user_config>, <yaml_config PathElem working_dir>, <yaml_config ListElem disable_plugins>, <yaml_config StrElem shared_group>, <yaml_config StrElem umask>, <yaml_config IntRangeElem build_threads>, <yaml_config StrElem log_format>, <yaml_config StrElem log_level>, <yaml_config PathElem result_log>, <yaml_config PathElem exception_log>, <yaml_config IntElem wget_timeout>, <yaml_config CategoryElem proxies>, <yaml_config ListElem no_proxy>, <yaml_config ListElem env_setup>, <yaml_config CategoryElem default_results>, <yaml_config PathElem pav_cfg_file>, <yaml_config PathElem pav_root>, <yaml_config KeyedElem pav_vars>]
pavilion.config.config_dirs_validator(config, values)

Get all of the configurations directories and convert them into path objects.

pavilion.config.find(warn=True)

Search for a pavilion.yaml configuration file. Use the one pointed to by the PAV_CONFIG_FILE environment variable. Otherwise, use the first found in these directories the default config search paths:

  • The ~/.pavilion directory
  • The Pavilion source directory (don’t put your config here).