From 57754f209fb664c17e63d65512f80af40ac5872c Mon Sep 17 00:00:00 2001 From: Federico Ponzi Date: Sun, 16 Feb 2020 17:19:27 +0100 Subject: [PATCH] fix args usage --- isitdown/isitdown.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/isitdown/isitdown.py b/isitdown/isitdown.py index f106a5c..03777ec 100644 --- a/isitdown/isitdown.py +++ b/isitdown/isitdown.py @@ -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 @@ -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)