fix(portal): use hashed fingerprint and cloud account in logging
This commit is contained in:
parent
0a72aeed96
commit
9253be892d
1 changed files with 4 additions and 4 deletions
|
@ -31,13 +31,13 @@ class BlockBridgeAutomation(BaseAutomation):
|
|||
bridge = bridge_select_func(id_)
|
||||
if bridge is None:
|
||||
continue
|
||||
logging.debug("Found %s blocked", bridge.fingerprint)
|
||||
logging.debug("Found %s blocked", bridge.hashed_fingerprint)
|
||||
if bridge.added > datetime.utcnow() - timedelta(hours=3):
|
||||
logging.debug("Not rotating a bridge less than 3 hours old")
|
||||
continue
|
||||
if bridge.deprecate(reason=self.short_name):
|
||||
logging.info("Rotated %s", bridge.fingerprint)
|
||||
rotated.append((bridge.fingerprint, bridge.conf.provider))
|
||||
logging.info("Rotated %s", bridge.hashed_fingerprint)
|
||||
rotated.append((bridge.fingerprint, bridge.cloud_account.provider, bridge.cloud_account.description))
|
||||
else:
|
||||
logging.debug("Not rotating a bridge that is already deprecated")
|
||||
return rotated
|
||||
|
@ -58,7 +58,7 @@ class BlockBridgeAutomation(BaseAutomation):
|
|||
activity = Activity(
|
||||
activity_type="block",
|
||||
text=(f"[{self.short_name}] ♻ Rotated {len(rotated)} bridges: \n"
|
||||
+ "\n".join([f"* {fingerprint} ({provider})" for fingerprint, provider in rotated]))
|
||||
+ "\n".join([f"* {fingerprint} ({provider}: {provider_description})" for fingerprint, provider, provider_description in rotated]))
|
||||
)
|
||||
db.session.add(activity)
|
||||
activity.notify()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue