def healthcheck_ping(req_obj, url, start=False): if start == True: url + '/start' try: req_obj.get(url, timeout=10) except req_obj.RequestException as e: # Log ping failure here... print("Ping failed: %s" % e)