add proper check for DNS error in list_target_files (#1625)

The elif needed to check to see if the string was in the listing of results of the shell command.  As it was the conditional was just the string which always evaluates to true and was therefore giving a misleading error message.
This commit is contained in:
captainwasabi 2019-08-13 05:47:11 -04:00 committed by Joshua Tauberer
parent e37768ca86
commit 0657f9e875
1 changed files with 1 additions and 1 deletions

View File

@ -406,7 +406,7 @@ def list_target_files(config):
reason = "Provided path {} is invalid.".format(target_path) reason = "Provided path {} is invalid.".format(target_path)
elif 'Network is unreachable' in listing: elif 'Network is unreachable' in listing:
reason = "The IP address {} is unreachable.".format(target.hostname) reason = "The IP address {} is unreachable.".format(target.hostname)
elif 'Could not resolve hostname': elif 'Could not resolve hostname' in listing:
reason = "The hostname {} cannot be resolved.".format(target.hostname) reason = "The hostname {} cannot be resolved.".format(target.hostname)
else: else:
reason = "Unknown error." \ reason = "Unknown error." \