1. Calling methods
From fabric import Hosts,roles,runs_once,with_settings,task,serial,parallel
2. Use of adorners:
(1) @hosts (ip1,ip2,...) #类似于env. Hosts, except that it only works on the classes it modifies.
(2) @roles (identity 1, Identity 2) #当用env. roledefs={identity 1:[ip list], ...} Once defined, you can use the roles decorator to select the IP list you want to execute.
(3) @with_settings (env variable = value,...) #它的用法和with settings (): Same, the only difference is that its scope is the whole method
(4) @task #当执行fab-F file name-L, the execution results list all the method names in the file, but if @task is added, the result of fab-f file name-L is only the method name modified by @task
(5) @serial #用串行的方式执行 (that is, when one host completes, another host is executed)
(6) @parallel (pool_size=??) #用并行的方式执行, Pool_size sets the maximum number of parallel
This article from "My Sky" blog, declined reprint!
Fabric Decorator Class