gluetool framework is a command-line centric, modular Python framework. It allows to quickly develop modules which can be executed on the command-line by the
gluetool command, forming a sequential pipeline.
gluetool framework was created with various features in mind. These should provide an easy and straightforward way how to write, configure and execute modules.
The core of the framework is completely decoupled from the modules and their specific functionality. It could be used for implementation of other tools.
The framework provides an easy way how to define configuration for the framework and the modules. The configuration files use the ConfigParser format. The configuration option key in the config file is the long option string as defined in the
gluetool searches for configuration files in several directories, in specific order, and it opens relevant files
in all of them if they are present there, with, given the order in which directories are being examined, values
from later files replace those from the former ones.
Following directories are examined (the list is defined as
The configuration directory layout is:
~/.gluetool.d/ ├── gluetool - gluetool configuration └── config - per module configurations, one file per unique module name ├── <module_config_file> └── ...
Note that this directory can be used for storing additional configuration files and directories according to the needs of the modules.
The gluetool file defines the default options for the
gluetool command itself. It can be used to define defaults for any of the supported options. The options need to be defined in the
[default] section. You can view all the supported options of
gluetool by running the command
gluetool -h. For example, to enable the debug mode by default, we can use this configuration
$ cat ~/.gluetool.d/gluetool [default] debug = True
The config subdirectory can define a default configuration for each module. The configuration filename must be the same as the module’s
name. All options must be defined in the
[default] section of the configuration file. You can view the module available options by running
gluetool <module> -h, e.g.
gluetool openstack -h for the (hypothetical)
Below is an example of configuration for this
$ cat ~/.gluetool.d/config/openstack [default] auth-url = https://our-instance.openstack.com:13000/v2.0 username = batman password = YOUR_SECRET_PASSWORD project-name = gotham_ci ssh-key = ~/.ssh/id_rsa ssh-user = root key-name = id_rsa ip-pool-name = 10.8.240.0
gluetool framework provides uniform logging. Modules can use their own
verbose methods to log messages on different log levels. The log level can be changed using the
-v/--verbose options of the
Note that the
-v/--verboseoptions will enable the logging after parsing the command line and configuration. To enable the debug mode as early as possible, i.e. during the initialization of the logging system, export the variable
GLUETOOL_DEBUGto any value.