Skip to content

Commit

Permalink
param fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DonKannalie committed Jan 5, 2022
1 parent dbf649d commit a5517ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions storm/cli_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def ping_host_(name, glob, n, config):
if ips:
for ip in ips:
host_name = storm_.get_host_by_ip(ip)
if len(host_name) > 1:
cprint(f"Multiple hosts for ip {ip} found. {host_name}", 'error')
exit(0)
to_ping.append([host_name, ip])
else:
cprint(f"No hosts found matching '{name[0]}'", 'error')
Expand Down
3 changes: 2 additions & 1 deletion storm/storm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ping: add message when pinging
ping: flag keep on pinging
check server not working
add find duplicates host - ip function
"""

from __future__ import print_function
Expand Down Expand Up @@ -170,7 +171,7 @@ def search_host(self, search_string, exact_search=False):
def get_host_by_ip(self, search_string):
host = self.ssh_config.search_byip(search_string)
if host:
return ''.join(host)
return host
else:
return None

Expand Down

0 comments on commit a5517ee

Please sign in to comment.