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_)
|
bridge = bridge_select_func(id_)
|
||||||
if bridge is None:
|
if bridge is None:
|
||||||
continue
|
continue
|
||||||
logging.debug("Found %s blocked", bridge.fingerprint)
|
logging.debug("Found %s blocked", bridge.hashed_fingerprint)
|
||||||
if bridge.added > datetime.utcnow() - timedelta(hours=3):
|
if bridge.added > datetime.utcnow() - timedelta(hours=3):
|
||||||
logging.debug("Not rotating a bridge less than 3 hours old")
|
logging.debug("Not rotating a bridge less than 3 hours old")
|
||||||
continue
|
continue
|
||||||
if bridge.deprecate(reason=self.short_name):
|
if bridge.deprecate(reason=self.short_name):
|
||||||
logging.info("Rotated %s", bridge.fingerprint)
|
logging.info("Rotated %s", bridge.hashed_fingerprint)
|
||||||
rotated.append((bridge.fingerprint, bridge.conf.provider))
|
rotated.append((bridge.fingerprint, bridge.cloud_account.provider, bridge.cloud_account.description))
|
||||||
else:
|
else:
|
||||||
logging.debug("Not rotating a bridge that is already deprecated")
|
logging.debug("Not rotating a bridge that is already deprecated")
|
||||||
return rotated
|
return rotated
|
||||||
|
@ -58,7 +58,7 @@ class BlockBridgeAutomation(BaseAutomation):
|
||||||
activity = Activity(
|
activity = Activity(
|
||||||
activity_type="block",
|
activity_type="block",
|
||||||
text=(f"[{self.short_name}] ♻ Rotated {len(rotated)} bridges: \n"
|
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)
|
db.session.add(activity)
|
||||||
activity.notify()
|
activity.notify()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue