Trying to figure out how to pass a variable to fabric but having issues:
def installpatch(install):
sudo("apt-get install %s") % install
user@linux: fab installpatch:vi
Fatal error: sudo() received nonzero return code 100 while executing!
Requested: apt-get install %s
Executed: sudo -S -p 'sudo password:' /bin/bash -l -c "apt-get install %s"
fab installpatch:'vi'
Try the following:
sudo(("apt-get install %s") % install)
or
sudo("apt-get install {}".format(install))
The % operator in your question works only when combined with a string.