This works just fine
@task
def foo(context):
with context.cd('/'):
context.run('pwd')
Output:
/
But this does not:
@task
def bar(context):
with context.cd('/'):
context.sudo('pwd', password='mysecretpassword')
Output:
[sudo] password: sudo: cd: Befehl nicht gefunden
How do I get the second example to run?
f
means before the string. Is a new way to format text strings introduced in python 3.6. It's beautiful and simpler than all other methods: python.org/dev/peps/pep-0498 – Danialah