Jeff Honey
2018-04-17 15:27:25 UTC
So, I've been trying to add some more intelligence to my Fabric functions and am running into difficulties.
Say, I wanted to include env.host string as a variable into a put() call.
def myput():
myvar=env.host_string
put('/source/$myvar-*','/mydest/', mode=0644)
...which returns a ValueError.
if I try this, as I would with a runtime argument.
def myput():
myvar=env.host_string
put('/source/%s-*','/mydest/' % myvar)
...which returns a Type Error.
Is there a simple way to overcome my lack of python knowledge here?
--
€€€€€€€€€€€€€€€€€€
€ kyoboku kazeoshi €
€€€€€€€€€€€€€€€€€€
Say, I wanted to include env.host string as a variable into a put() call.
def myput():
myvar=env.host_string
put('/source/$myvar-*','/mydest/', mode=0644)
...which returns a ValueError.
if I try this, as I would with a runtime argument.
def myput():
myvar=env.host_string
put('/source/%s-*','/mydest/' % myvar)
...which returns a Type Error.
Is there a simple way to overcome my lack of python knowledge here?
--
€€€€€€€€€€€€€€€€€€
€ kyoboku kazeoshi €
€€€€€€€€€€€€€€€€€€