Copies file from remote host to local host.
This method may not perform as expected. Given a remote src, a local dest, and the hostname of the remote device, the final location will look like this on the local machine:
path/to/dest/hostname/path/to/src/file.txt
To change this refer to argument flat
def test_fun(duthosts, rand_one_dut_hostname):
duthost = duthosts[rand_one_dut_hostname]
duthost.fetch(src="/remote/file/path.txt/", dest="/local/file/path.txt")
src
- Source of file on the remote host- Required:
True
- Type:
String
- Required:
dest
- Destination for file on local host- Required:
True
- Type:
String
- Required:
fail_on_missing
- Whether task should fail if file is not found atsrc
- Required:
False
- Type:
Boolean
- Default:
True
- Required:
flat
- IfFalse
, file will be copied topath/to/local/dest/remote_hostname/path/to/remote/src/file
. IfTrue
, file will be copied topath/to/local/dest/file
.- Required:
False
- Type:
Boolean
- Default:
False
- Required:
validate_checksum
- Verify that source and destination checksums match- Required:
False
- Type:
Boolean
- Default:
True
- Required:
This method provides no useful output.