开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜