Created
September 9, 2016 05:53
-
-
Save jmlrt/5acca62d5480577ead9349545bb05cc2 to your computer and use it in GitHub Desktop.
Fabfile sample using require function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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