Use debug flag

merge-requests/30/head
Bob Mottram 2024-02-10 11:27:24 +00:00
parent 79d06dfdfa
commit de6f415768
1 changed files with 7 additions and 4 deletions

View File

@ -1892,6 +1892,7 @@ def _update_federated_blocks(session, base_dir: str,
} }
block_federated_endpoints = load_federated_blocks_endpoints(base_dir) block_federated_endpoints = load_federated_blocks_endpoints(base_dir)
if debug:
print('DEBUG: federated blocklist endpoints: ' + print('DEBUG: federated blocklist endpoints: ' +
str(block_federated_endpoints)) str(block_federated_endpoints))
@ -1901,6 +1902,7 @@ def _update_federated_blocks(session, base_dir: str,
continue continue
url = endpoint.strip() url = endpoint.strip()
if debug:
print('federated blocklist Block API endpoint: ' + url) print('federated blocklist Block API endpoint: ' + url)
blocked_json = get_json(signing_priv_key_pem, session, url, headers, blocked_json = get_json(signing_priv_key_pem, session, url, headers,
None, debug, version, http_prefix, domain) None, debug, version, http_prefix, domain)
@ -1908,6 +1910,7 @@ def _update_federated_blocks(session, base_dir: str,
print('DEBUG: federated blocklist ' + print('DEBUG: federated blocklist ' +
'GET blocked json failed ' + url) 'GET blocked json failed ' + url)
continue continue
if debug:
print('DEBUG: federated blocklist: ' + str(blocked_json)) print('DEBUG: federated blocklist: ' + str(blocked_json))
if isinstance(blocked_json, list): if isinstance(blocked_json, list):
# ensure that the size of the list does not become a form of denial # ensure that the size of the list does not become a form of denial