How to make Fabric ignore offline hosts in the env.hosts list?

前端 未结 4 1301
旧时难觅i
旧时难觅i 2021-02-14 02:44

This is related to my previous question, but a different one.

I have the following fabfile:

from fabric.api import *

host1 = \'192.168.200.181\'
offli         


        
4条回答
  •  星月不相逢
    2021-02-14 03:30

    As of version 1.4 Fabric has a --skip-bad-hosts option that can be set from the command line, or by setting the variable in your fab file.

    env.skip_bad_hosts = True
    

    Documentation for the option is here: http://docs.fabfile.org/en/latest/usage/fab.html#cmdoption--skip-bad-hosts

    Don't forget to explicitly set the timeout value also.

提交回复
热议问题