Skip to content
This repository was archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
fix args usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Ponzi committed Feb 16, 2020
1 parent 9119579 commit 57754f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions isitdown/isitdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, config, logger):
self.config = config
self.logger = logger

def do_ping(self, host, ip, prefix="https://", from_api=0):
def do_ping(self, host, ip, from_api, prefix="https://"):
"""
Args:
host: host to ping
Expand All @@ -65,10 +65,10 @@ def do_ping(self, host, ip, prefix="https://", from_api=0):
PingRepository.add_ping(p)
return p
except Exception as e:
self.logger.error("Exception while contacting {}. Exception: {} ".format(host, e))
self.logger.debug("Exception while contacting {}. Exception: {} ".format(host, e))
# Check both https and http:
if "Connection refused" in repr(e) and prefix == "https://":
return self.do_ping(host, ip, prefix="http://", from_api=from_api)
return self.do_ping(host, ip, from_api=from_api, prefix="http://")
p = Ping(from_ip=ip, host=host, timestamp=datetime.utcnow(), isdown=True,
response_code=-1, from_api=from_api)
PingRepository.add_ping(p)
Expand Down

0 comments on commit 57754f2

Please sign in to comment.