log.debug("_json_asok output empty")
return None
- def is_addr_blocklisted(self, addr=None):
- if addr is None:
- log.warn("Couldn't get the client address, so the blocklisted "
- "status undetermined")
- return False
-
- blocklist = json.loads(self.mon_manager.run_cluster_cmd(
- args=["osd", "blocklist", "ls", "--format=json"],
- stdout=StringIO()).stdout.getvalue())
- for b in blocklist:
- if addr == b["addr"]:
- return True
+ def is_addr_blocklisted(self, addr):
+ blocklist = json.loads(self.mon_manager.raw_cluster_cmd(
+ "osd", "dump", "--format=json"))['blocklist']
+ if addr in blocklist:
+ return True
+ log.warn(f'The address {addr} is not blocklisted')
return False