mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
tests: helper to copy files from one host to another
Simple function that takes a list of file names and copies them from one host to another. It isn't the most efficient but for a small number of files it should be sufficient. Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
parent
b89aa91977
commit
06a8791b9b
@ -2920,3 +2920,15 @@ def move_date(host, chrony_cmd, date_str):
|
||||
"""
|
||||
host.run_command(['systemctl', chrony_cmd, 'chronyd'])
|
||||
host.run_command(['date', '-s', date_str])
|
||||
|
||||
|
||||
def copy_files(source_host, dest_host, filelist):
|
||||
"""Helper to copy a file from one host to another
|
||||
:param source_host: source host of the file to copy
|
||||
:param dest_host: destination host
|
||||
:param filelist: list of full path of files to copy
|
||||
"""
|
||||
for file in filelist:
|
||||
dest_host.transport.mkdir_recursive(os.path.dirname(file))
|
||||
data = source_host.get_file_contents(file)
|
||||
dest_host.transport.put_file_contents(file, data)
|
||||
|
Loading…
Reference in New Issue
Block a user