if block['block_level'] == "silence":
logger.debug("Block level 'silence' has been changed to 'silenced'")
block['block_level'] = "silenced"
+ elif block['block_level'] == "suspend":
+ logger.debug("Block level 'suspend' has been changed to 'suspended'")
+ block['block_level'] = "suspended"
if not blocks.is_instance_blocked(blocker, block['blocked'], block['block_level']):
logger.debug("Invoking blocks.add_instance(%s, %s, %s, %s)", blocker, block['blocked'], block['reason'], block['block_level'])
raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not 'str'")
elif block_level == "":
raise ValueError("Parameter 'block_level' is empty")
- elif block_level in ["accept", "suspended", "silence"]:
+ elif block_level in ["accept", "suspend", "silence"]:
raise ValueError(f"block_level='{block_level}' is not wanted.")
logger.debug("Updating block reason='%s',blocker='%s',blocked='%s',block_level='%s'", reason, blocker, blocked, block_level)
raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not 'str'")
elif block_level == "":
raise ValueError("Parameter 'block_level' is empty")
- elif block_level in ["accept", "suspended", "silence"]:
+ elif block_level in ["accept", "suspend", "silence"]:
raise ValueError(f"blocked='{blocked}' has unwanted block_level='{block_level}'")
database.cursor.execute(
raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not of type 'str'")
elif block_level == "":
raise ValueError("Parameter 'block_level' is empty")
- elif block_level in ["accept", "suspended", "silence"]:
+ elif block_level in ["accept", "suspend", "silence"]:
raise ValueError(f"blocked='{blocked}' has unwanted block_level='{block_level}'")
database.cursor.execute(
raise Exception(f"blocker='{blocker}' is blacklisted but function invoked")
elif blacklist.is_blacklisted(blocked):
raise Exception(f"blocked='{blocked}' is blacklisted but function invoked")
- elif block_level in ["accept", "suspended", "silence"]:
+ elif block_level in ["accept", "suspend", "silence"]:
raise ValueError(f"blocked='{blocked}' has unwanted block_level='{block_level}'")
if reason is not None:
"blocker" : domain,
"blocked" : tidyup.domain(instance["host"]),
"reason" : None,
- "block_level": "suspend",
+ "block_level": "suspended",
})
logger.debug("count=%d", count)
elif block_level == "accept":
logger.debug("domain='%s' skipping block_level='accept'", domain)
continue
- elif block_level == "suspended":
- logger.debug("domain='%s', mapping 'suspended' to 'suspend'", domain)
- block_level = "suspend"
+ elif block_level == "suspend":
+ logger.debug("domain='%s', mapping 'suspend' to 'suspended'", domain)
+ block_level = "suspended"
elif block_level == "silence":
logger.debug("domain='%s', mapping 'silence' to 'silenced'", domain)
block_level = "silenced"
elif block_level == "accept":
logger.debug("domain='%s' skipping block_level='accept'", domain)
continue
- elif block_level == "suspended":
- logger.debug("domain='%s', mapping 'suspended' to 'suspend'", domain)
- block_level = "suspend"
+ elif block_level == "suspend":
+ logger.debug("domain='%s', mapping 'suspend' to 'suspended'", domain)
+ block_level = "suspended"
elif block_level == "silence":
logger.debug("domain='%s', mapping 'silence' to 'silenced'", domain)
block_level = "silenced"