我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用fabric.api.env.warn_only()。
def _config_fabric(self): env.host_string = 'localhost' env.warn_only = True for c in output.keys(): output[c] = False
def setup_fabric(): env.user = 'root' env.abort_exception = UpgradeError env.key_filename = settings.SSH_KEY_FILENAME env.warn_only = True output.stdout = False output.aborts = False
def pre_start_hook(app): from ..nodes.models import Node # env.warn_only = True env.user = 'root' env.key_filename = SSH_KEY_FILENAME output.stdout = False output.running = False PLUGIN_DIR = '/usr/libexec/kubernetes/kubelet-plugins/net/exec/kuberdock/' with app.app_context(): for node in Node.query.all(): env.host_string = node.hostname put('./node_network_plugin.sh', PLUGIN_DIR + 'kuberdock') put('./node_network_plugin.py', PLUGIN_DIR + 'kuberdock.py') run('systemctl restart kuberdock-watcher') print 'Kuberdock node parts are updated'
def _init_fabric(self): env.warn_only = True env.connection_attempts = 10 env.timeout = 10 env.user = self.user env.key_filename = self.key_filename env.hosts = self.hosts env.password = self.password