I have a fabfile (fabfile.py) with some tasks declared:
# fabfile.py
from fabric.api import *
@task
def start():
# code
@task
def stop():
# code
Then when I try to call any of those tasks using the execute function from fabric like this:
# main.py
from fabric.api import execute
from fabfile import * # I don't really know if this is necessary
# or how should it be done
def main():
execute('start')
It raises this error:
Fatal error: None is not callable or a valid task name
My intention is to make a kind of wrapper for some tasks specified in that fabfile that can be called with different arguments, and the task to perform must be taken from the arguments when you make a call to this main program, so I can't explicitly call the function, but use the task names.
How would this be done? Maybe I'm misunderstanding how fabric is supposed to work?
Thank you
fab -h
, it gives:-f PATH, --fabfile=PATH
. – Tetrafluoroethylene