test_remote.Rd
Test remote execution
test_remote(host, stderr = TRUE, ...)
TRUE
is remote execution is successful.
If unsuccessful, depends on the value of stderr
.
If stderr
= TRUE (default), this function will throw an error.
If stderr
= FALSE, this function will print a logger error and return FALSE.
# Localhost execution should always work
good_host <- list(name = "localhost")
test_remote(good_host)
#> [1] TRUE
bad_host <- list(name = "bigbadwolf")
if (!test_remote(bad_host, stderr = FALSE)) {
print("Big Bad Wolf is a bad host.")
}
#> Warning: running command ''ssh' -T bigbadwolf echo Testing remote bigbadwolf 2>/dev/null' had status 255 and error message 'Function not implemented'
#> [1] "Big Bad Wolf is a bad host."