Using chut with Fabric

Chut contains some helpers to generate and use chut scripts with Fabric.

class chut.Fab[source]
chutifab(*args)[source]

Generate chut scripts contained in location

run(script, *args, **kwargs)[source]

Upload a script and run it. *args are used as command line arguments. **kwargs are passed to fabric‘s run

sudo(script, *args, **kwargs)[source]

Upload a script and run it using sudo. *args are used as command line arguments. **kwargs are passed to fabric‘s sudo

Here is a sample fabfile.py

# -*- coding: utf-8 -*-
from fabric.api import env
from chut import fab

env.forward_agent = True

fab.chutifab()


def upgrade():
    fab.run('rfsync', '-h')
    fab.sudo('rfsync', '-h')