Skip to content

Instantly share code, notes, and snippets.

@ampledata
Created November 19, 2012 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ampledata/4114757 to your computer and use it in GitHub Desktop.
Save ampledata/4114757 to your computer and use it in GitHub Desktop.
import fabric.api
import fabric.state
@fabric.api.parallel
def _sudo(cmd):
"""Wraps ``fabric.operations.sudo`` with custom stuff."""
fabric.operations.sudo("sudo gba %s" % cmd)
def uptime():
"""Gets uptime on hosts."""
fabric.state.env.hosts = ['web1', 'web2']
_sudo('uptime')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment