for instance in rows:
# Is it there?
logger.debug("instance[]='%s'", type(instance))
+ if "host" not in instance:
+ logger.warning("instance(%d)='%s' has no key 'host' - SKIPPED!", len(instance), instance)
+ continue
+ elif instance["host"] is None or instance["host"] == "":
+ logger.debug("instance[host]='%s' is None or empty - SKIPPED!", instance["host"])
+ continue
+
+ logger.debug("instance[host]='%s' - BEFORE!", instance["host"])
blocked = tidyup.domain(instance["host"])
- logger.debug("blocked='%s'", blocked)
- if not domain_helper.is_wanted(blocked):
+ logger.debug("blocked[%s]='%s' - AFTER!", type(blocked), blocked)
+ if blocked is None or blocked == "":
+ logger.warning("instance[host]='%s' is None or empty after tidyup.domain() - SKIPPED!", instance["host"])
+ continue
+ elif not domain_helper.is_wanted(blocked):
logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
continue
elif "isSuspended" in instance and instance["isSuspended"] and not dict_helper.has_key(blocklist, "blocked", blocked):