How to pass bool argument to fabric command
boolean, fabric, python
Solution
As mentioned in the fabric docs, all the arguments end up as strings. The simplest thing to do here would just check the argument:
def myfunc(arg1, arg2):
arg1 = (arg1 == 'True')
The parentheses aren't required, but help with readability.
Edit: Apparently I didn't actually try my previous answer; updated. (Two years later.)
Problem
Currently I'm using `fab -f check_remote.py func:"arg1","arg2"...` to run fab remote. Now I need to send a bool arg, but True/False become a string arg, how to set it as bool type?