raise data["exception"]
elif "error_message" in data:
logger.debug("Returned error_message during fetching nodeinfo: '%s',status_code=%d", data['error_message'], data['status_code'])
- return fetch_generator_from_path(domain)
- elif "status" in data and data["status"] == "error" and "message" in data:
- logger.warning("JSON response is an error: '%s'", data["message"])
- instances.set_last_error(domain, data["message"])
- return fetch_generator_from_path(domain)
- elif "message" in data:
- logger.warning("JSON response contains only a message: '%s'", data["message"])
- instances.set_last_error(domain, data["message"])
- return fetch_generator_from_path(domain)
- elif "json" not in data or "software" not in data["json"] or "name" not in data["json"]["software"]:
+ software = fetch_generator_from_path(domain)
+ logger.debug("Generator for domain='%s' is: '%s'", domain, software)
+ elif "json" in data:
+ logger.debug("domain='%s',path='%s',data[json] found ...", domain, path)
+ if "status" in data["json"] and data["json"]["status"] == "error" and "message" in data["json"]:
+ logger.warning("JSON response is an error: '%s'", data["json"]["message"])
+ instances.set_last_error(domain, data["json"]["message"])
+ instances.set_detection_mode(domain, None)
+ instances.set_nodeinfo_url(domain, None)
+ software = fetch_generator_from_path(domain)
+ logger.debug("Generator for domain='%s' is: '%s'", domain, software)
+ elif "software" in data["json"] and "name" in data["json"]["software"]:
+ logger.debug("Found data[json][software][name] in JSON response")
+ software = data["json"]["software"]["name"]
+ logger.debug("software[%s]='%s' - FOUND!", type(software), software)
+ elif "message" in data["json"]:
+ logger.warning("JSON response contains only a message: '%s'", data["json"]["message"])
+ instances.set_last_error(domain, data["json"]["message"])
+ instances.set_detection_mode(domain, None)
+ instances.set_nodeinfo_url(domain, None)
+ software = fetch_generator_from_path(domain)
+ logger.debug("Generator for domain='%s' is: '%s'", domain, software)
+ elif "software" not in data["json"] or "name" not in data["json"]["software"]:
+ logger.debug("JSON response from domain='%s' does not include [software][name], fetching / ...", domain)
+ instances.set_detection_mode(domain, None)
+ instances.set_nodeinfo_url(domain, None)
+ software = fetch_generator_from_path(domain)
+ logger.debug("Generator for domain='%s' is: '%s'", domain, software)
+ elif "json" not in data:
logger.debug("JSON response from domain='%s' does not include [software][name], fetching / ...", domain)
software = fetch_generator_from_path(domain)
logger.debug("Generator for domain='%s' is: '%s'", domain, software)
- elif "json" in data and "software" in data["json"] and "name" in data["json"]["software"]:
- logger.debug("Found data[json][software][name] in JSON response")
- software = data["json"]["software"]["name"]
logger.debug("software[%s]='%s'", type(software), software)
if software is None:
if not isinstance(path, str):
raise ValueError(f"path[]='{type(path)}' is not 'str'")
elif path == "":
- raise ValueError("Parameter 'path' cannot be empty")
+ raise ValueError("Parameter 'path' is empty")
elif not isinstance(data, str):
raise ValueError(f"data[]='{type(data)}' is not 'str'")
elif not isinstance(headers, dict):
if not isinstance(path, str):
raise ValueError(f"path[]='{type(path)}' is not 'str'")
elif path == "":
- raise ValueError("Parameter 'path' cannot be empty")
+ raise ValueError("Parameter 'path' is empty")
elif not isinstance(headers, dict):
raise ValueError(f"headers[]='{type(headers)}' is not 'list'")
elif not isinstance(timeout, tuple):
logger.debug("key='%s',domain='%s',value[]='%s' - CALLED!", key, domain, type(value))
domain_helper.raise_on(domain)
if not isinstance(key, str):
- raise ValueError("Parameter key[]='{type(key)}' is not 'str'")
+ raise ValueError(f"Parameter key[]='{type(key)}' is not 'str'")
elif key == "":
raise ValueError("Parameter 'key' is empty")
elif not key in _pending:
logger.debug("domain='%s',url='%s' - CALLED!", domain, url)
domain_helper.raise_on(domain)
- if not isinstance(url, str):
- raise ValueError("Parameter url[]='{type(url)}' is not 'list'")
+ if not isinstance(url, str) and url is not None:
+ raise ValueError(f"Parameter url[]='{type(url)}' is not 'str'")
elif url == "":
raise ValueError("Parameter 'url' is empty")
logger.debug("domain='%s',mode='%s' - CALLED!", domain, mode)
domain_helper.raise_on(domain)
- if not isinstance(mode, str):
- raise ValueError("Parameter mode[]='{type(mode)}' is not 'list'")
+ if not isinstance(mode, str) and mode is not None:
+ raise ValueError(f"Parameter mode[]='{type(mode)}' is not 'str'")
elif mode == "":
raise ValueError("Parameter 'mode' is empty")