Commit 1d544ba3 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Check whether path is valid before accessing it

Reviewed-by: ultrotter
parent ffeffa1d
......@@ -163,14 +163,14 @@ class SshRunner:
success: True/False
"""
if not os.path.isfile(filename):
logger.Error("file %s does not exist" % (filename))
return False
if not os.path.isabs(filename):
logger.Error("file %s must be an absolute path" % (filename))
return False
if not os.path.isfile(filename):
logger.Error("file %s does not exist" % (filename))
return False
command = [constants.SCP, "-q", "-p"]
command.extend(KNOWN_HOSTS_OPTS)
command.extend(BATCH_MODE_OPTS)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment