diff options
| author | Tom Ritter <tom@ritter.vg> | 2018-01-05 22:30:31 -0600 |
|---|---|---|
| committer | Tom Ritter <tom@ritter.vg> | 2018-01-05 22:30:31 -0600 |
| commit | d038a0d05f62d7f390818e97dbd9204e72f5fced (patch) | |
| tree | b1882bcccebb0cce15de18f0bf99744691f2d92a | |
| parent | 62a10c50ccb4956ebcd6c010ddf93139c0cc54b6 (diff) | |
Refactor the FallbackDir Pseudo-Flag (part of #24691)
| -rw-r--r-- | data/consensus.cfg | 2 | ||||
| -rwxr-xr-x | website.py | 22 |
2 files changed, 17 insertions, 7 deletions
diff --git a/data/consensus.cfg b/data/consensus.cfg index e05818f..fd7a7bb 100644 --- a/data/consensus.cfg +++ b/data/consensus.cfg @@ -1,7 +1,7 @@ # control consensus-health output # do not show all fallback directory output -ignore_fallback_authorities True +ignore_fallback_authorities False # do not show values less than this amount on the graph. For small testing networks set to 1 graph_logical_min 125 @@ -107,6 +107,21 @@ class WebsiteWriter: self.consensus.known_flags.append('ReachableIPv6') self.consensus.known_flags.append('NoIPv6Consensus') + # Add the FallbackDir flag + if not self.config['ignore_fallback_authorities']: + self.consensus.known_flags.append('FallbackDir') + for dirauth_nickname in self.known_authorities: + if dirauth_nickname in self.votes: + vote = self.votes[dirauth_nickname] + vote.known_flags.append('FallbackDir') + for r in vote.routers: + if r in self.fallback_dirs: + vote.routers[r].flags.append('FallbackDir') + for r in self.consensus.routers: + if r in self.fallback_dirs: + self.consensus.routers[r].flags.append('FallbackDir') + + #----------------------------------------------------------------------------------------- def _write_page_header(self, include_relay_info): """ @@ -962,7 +977,7 @@ class WebsiteWriter: Write the status of the fallback directory mirrors """ if self.config['ignore_fallback_authorities']: - return + return self.site.write("<br>\n\n\n" + " <!-- ================================================================= -->" @@ -1426,11 +1441,6 @@ class WebsiteWriter: self.site.write("bwauth=" + ",".join(assigning_bwauths)) flagsWritten += 1 - if relay_fp in self.fallback_dirs: - self.site.write(" <br />" if flagsWritten > 0 else "") - self.site.write("FallbackDir") - flagsWritten += 1 - self.site.write("</td>\n") else: self.site.write(" <td></td>\n") |
