buildtest.cli.config

Module Contents

Functions

config_cmd(args, configuration, editor, system)

Entry point for buildtest config command. This method will invoke other methods depending on input argument.

edit_configuration(configuration, editor)

This method will open configuration file in editor. The preferred editor will be determined based on environment

view_system(configuration)

This method implements command buildtest config systems which displays

validate_config(configuration, moduletool)

This method implements buildtest config validate which attempts to

view_path(configuration)

Display the path to configuration file regardless if file is valid

view_configuration(configuration[, theme, pager])

Display content of buildtest configuration file. This implements command buildtest config view

view_executors(configuration, buildexecutor[, ...])

Display executors from buildtest configuration. This implements buildtest config executors command.

buildtest.cli.config.config_cmd(args, configuration, editor, system)[source]

Entry point for buildtest config command. This method will invoke other methods depending on input argument.

Parameters
buildtest.cli.config.edit_configuration(configuration, editor)[source]

This method will open configuration file in editor. The preferred editor will be determined based on environment variable EDITOR if found otherwise will resort to vim.

Parameters

configuration (buildtest.config.SiteConfiguration) – Instance of SiteConfiguration class used for storing buildtest configuration

buildtest.cli.config.view_system(configuration)[source]

This method implements command buildtest config systems which displays system details from configuration file in table format.

Parameters

configuration (buildtest.config.SiteConfiguration) – An instance of SiteConfiguration class

buildtest.cli.config.validate_config(configuration, moduletool)[source]

This method implements buildtest config validate which attempts to validate buildtest schema file settings.schema.json. If it’s not validate an exception is raised which could be jsonschema.exceptions.ValidationError or buildtest.exceptions.ConfigurationError.

If configuration is valid buildtest print something as follows.

bash-3.2$ buildtest config validate
/Users/siddiq90/Documents/GitHubDesktop/buildtest/buildtest/settings/config.yml is valid

If there is an error validating configuration file, buildtest will print error message reported by exception

Parameters
Raises

SystemExit – If exception is raised during validating configuration file.

buildtest.cli.config.view_path(configuration)[source]

Display the path to configuration file regardless if file is valid

Parameters

configuration (buildtest.config.SiteConfiguration) – An instance of SiteConfiguration class

buildtest.cli.config.view_configuration(configuration, theme=None, pager=None)[source]

Display content of buildtest configuration file. This implements command buildtest config view

Parameters
buildtest.cli.config.view_executors(configuration, buildexecutor, json_format=False, yaml_format=False, disabled=False, invalid=False)[source]

Display executors from buildtest configuration. This implements buildtest config executors command.

Parameters
  • configuration (buildtest.config.SiteConfiguration) – An instance of SiteConfiguration class

  • buildexecutor (buildtest.executors.setup.BuildExecutor) – An instance of BuildExecutor class

  • json_format (bool) – Display output in json format which is specified via buildtest config executors --json

  • yaml_format (bool) – Display output in yaml format which is specified via buildtest config executors --yaml

  • disabled (bool) – Display list of disabled executors which is specified via buildtest config executors --disabled

  • invalid (bool) – Display list of invalid executors which is specified via buildtest config executors --invalid