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:
+ data = data["json"]
+ else:
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)
+ if "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"])
+ 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 and "name" in data["software"]:
+ logger.debug("Found data[json][software][name] in JSON response")
+ software = data["software"]["name"]
+ logger.debug("software[%s]='%s' - FOUND!", type(software), software)
+ elif "message" in data:
+ logger.warning("JSON response contains only a message: '%s'", data["message"])
+ instances.set_last_error(domain, data["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 or "name" not in data["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)
+
logger.debug("software[%s]='%s'", type(software), software)
if software is None:
logger.debug("Returning None - EXIT!")