You have to apply @task
decorator to all you functions:
@task
def install_nova():
...
@task
def deploy_vms():
...
If you don't use @task
, fabric will treats all functions as commands.
Вопрос
I am learning Python and playing around with the Fabric library. I learned that if you use fab --list
command, it shows you the list of available commands.
from fabric.api import *
from ConfigParser import SafeConfigParser
import os
def install_nova():
...
def deploy_vms():
...
where ...
represents the code to be executed for the given command. When I do fab --list
it should be only showing me the options install_nova
and deploy_vms
. However, I am getting this -
Available commands:
SafeConfigParser
deploy_vms
install_nova
I have following questions -
SafeConfigParser
appearing as an available commands?SafeConfigParser
from the available commands option?Fabric version is :
Fabric 1.8.0
Paramiko 1.11.2
And python version is :
Python 2.7.5
Решение
You have to apply @task
decorator to all you functions:
@task
def install_nova():
...
@task
def deploy_vms():
...
If you don't use @task
, fabric will treats all functions as commands.