Skip to content

Instantly share code, notes, and snippets.

@jmlrt
Created September 9, 2016 05:53
Show Gist options
  • Save jmlrt/5acca62d5480577ead9349545bb05cc2 to your computer and use it in GitHub Desktop.
Save jmlrt/5acca62d5480577ead9349545bb05cc2 to your computer and use it in GitHub Desktop.
Fabfile sample using require function
from fabric.api import *
def is_local():
if env.host == 'localhost':
env.lrun = local
else:
env.lrun = run
print('host %(host)s using function %(lrun)s' % env)
def host_type():
require('lrun', provided_by=is_local)
env.lrun('uname -s')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment