Fabric feature suggestion Revision 613532643934 (Wed Mar 30 2011 at 12:17) - Diff Link to this snippet: https://friendpaste.com/31BqBSiH9IeUuL5S4Dyq8Z Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 12345678910111213141516171819202122232425262728293031323334353637env_user = "toto"def function(use_sudo=False): run('mycommand', use_sudo) def function2(use_sudo=False): run('mycommand', use_sudo)if env_user != "root": use_sudo = Truefunction(use_sudo)function2(use_sudo)# INSTEAD OF:def function(): if env_user == "root": run('mycommand') else: sudo('mycommand')def function2(): if env_user == "root": run('mycommand') else: sudo('mycommand') function()function2()