Welcome to Glusto’s documentation!¶
Glusto is a framework designed to provide features commonly used in a remote/distributed environment via a single and easy-to-access object.
It started out as a port of some shell ssh functions I had written and was meant for use in PyUnit* tests and config scripts for Gluster.
I’ve removed the Gluster specifics from this package. Feel free to give it a go, and please let me know how it works out.
Some of the key concepts and features of Glusto:
- Glusto inherits from multiple classes providing configuration (yaml, json, ini), remote connection (SSH, SCP, RPyC), ANSI color output, logging, and unit test functionality (PyUnit, PyTest, Nose)–presenting them in a single global Class object.
- Glusto also acts as a global class for maintaining state and configuration data across multiple modules and classes.
- Glusto provides a wrapper utility (
/usr/bin/glusto) to help make configuration files available to test cases from the command-line.
Adding Glusto utilities to a Python module is as simple as an import.
To use Glusto in a module:
from glusto.core import Glusto as g
It is no longer necessary to say “Glusto Importo!” out loud before executing scripts using the Glusto module. The import statement is more than sufficient.
Table of Contents¶
- Installing Glusto
- Configuring Glusto
- Using Glusto
- Working With Remote Systems
- Passwordless SSH with Keys
- Run a Single Command via SSH
- Run a Single Command on the Localhost
- Run a Command on More than One Host
- Transferring Files To and From Remote Systems
- Listing SSH Connections
- Closing Connections
- Using RPyC
- Passwordless Connections
- Setting up Connections
- Making RPyC Calls
- Running Local Code on the Remote System
- Going Ape with Monkey-Patching
- Checking Connections
- Closing Connections
- Undeploying the RPyC Server
- Using Config Files with Glusto
- Loading Config Files
- Setting the Glusto Config Dictionary with a Config File
- Updating the Glusto Config Dictionary with a Config File
- Displaying Objects in Config File Format
- Storing Objects in Config File Format
- Loading Config from a String
- Adding Simple Configuration Capability to Your Own Class
- Handling Logging with Glusto
- Default Logging
- Setting up Logging
- Sending a Log Event
- Sending Log Events to Multiple Logfiles
- Show the Logfiles Attached to a Specific Logger
- Removing a Log
- Changing the Level of an Existing Log Handler
- Changing the Filename of an Existing Log Handler
- Clearing a Log
- Temporarily Disable Logging
- Logging with Color Text
- Handling Templates with Glusto
- PyUnit (unittest) and Glusto
- Running Unittests with Glusto
- Configuring Glusto for Unittests
- Writing Unittests
- To Do
- PyTest and Glusto
- Nose and Glusto
- Working with PyTest and Nose
- Dynamic Cartesian Product Test Case Creation
- Glusto Simple REST Client
- To Do