wrench

package
v0.0.0-...-2608902 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsActive

func IsActive(category, feature string) bool

IsActive returns true if a "wrench" of a certain category and feature should be "dropped in the works".

This function may be called at specific points in the Juju codebase to introduce otherwise hard to induce failure modes for the purposes of manual or CI testing. The "<juju_datadir>/wrench/" directory will be checked for "wrench files" which this function looks for.

Wrench files are line-based, with each line indicating some (mis-)feature to enable for a given part of the code. The should be created on the host where the fault should be triggered.

For example, /var/lib/juju/wrench/machine-agent could contain:

refuse-upgrade
fail-api-server-start

The caller need not worry about errors. Any errors that occur will be logged and false will be returned.

func IsEnabled

func IsEnabled() bool

IsEnabled returns true if the wrench feature is turned on globally.

func SetEnabled

func SetEnabled(next bool) bool

SetEnabled turns the wrench feature on or off globally.

If false is given, all future IsActive calls will unconditionally return false. If true is given, all future IsActive calls will return true for active wrenches.

The previous value for the global wrench enable flag is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL