fabric - $(env_name) not getting set
I would like to create env variables once to use elsewhere in my fabric file. For e开发者_如何学Pythonxample:
from fabric.api import *
# environments
def dtconfig():
env.path = 'David'
# tasks
def hello():
require('path', provided_by=[dtconfig])
print (env.path)
print ('Hello $(path)')
print ('Hello ' + env.path)
The output from running 'fab dtconfig hello' is:
David
Hello $(path)
Hello David
Why doesn't the $(path) get replaced with 'David'? thx
Looks like bash variables were removed in later versions of fabric. just used plain old %s string substitutions instead.
精彩评论