本文整理匯總了Python中st2actions.runners.ssh.parallel_ssh.ParallelSSHClient.put方法的典型用法代碼示例。如果您正苦於以下問題:Python ParallelSSHClient.put方法的具體用法?Python ParallelSSHClient.put怎麽用?Python ParallelSSHClient.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類st2actions.runners.ssh.parallel_ssh.ParallelSSHClient
的用法示例。
在下文中一共展示了ParallelSSHClient.put方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_put
# 需要導入模塊: from st2actions.runners.ssh.parallel_ssh import ParallelSSHClient [as 別名]
# 或者: from st2actions.runners.ssh.parallel_ssh.ParallelSSHClient import put [as 別名]
def test_put(self):
hosts = ['localhost', '127.0.0.1', 'st2build001']
client = ParallelSSHClient(hosts=hosts,
user='ubuntu',
pkey_file='~/.ssh/id_rsa',
connect=True)
client.put('/local/stuff', '/remote/stuff', mode=0744)
expected_kwargs = {
'mode': 0744,
'mirror_local_mode': False
}
for host in hosts:
hostname, _ = client._get_host_port_info(host)
client._hosts_client[hostname].put.assert_called_with('/local/stuff', '/remote/stuff',
**expected_kwargs)