diff options
author | Jordan <me@jordan.im> | 2022-09-13 12:07:08 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2022-09-13 12:07:08 -0700 |
commit | e0dd48e46a30758bdec617f4380ae6c450eda68a (patch) | |
tree | 53c980d47919b6e96317e40d9f2c5ce92acac36d | |
parent | f2758ebe64c47c4613203b2a42ef2367dd1a832d (diff) | |
download | allium-e0dd48e46a30758bdec617f4380ae6c450eda68a.tar.gz allium-e0dd48e46a30758bdec617f4380ae6c450eda68a.zip |
fix: transient absence of platform key/value; check before generation
-rw-r--r-- | allium/lib/relays.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/allium/lib/relays.py b/allium/lib/relays.py index 378e8dc..ba5a0ca 100644 --- a/allium/lib/relays.py +++ b/allium/lib/relays.py @@ -69,8 +69,9 @@ class Relays(): e.g. "Tor 0.3.4.9 on Linux" -> "Linux" ''' for relay in self.json['relays']: - relay['platform'] = relay['platform'].split(' on ', 1)[1].split(' ')[0] - relay['platform'] = relay['platform'].split('/')[-1] # GNU/* + if relay.get('platform'): + relay['platform'] = relay['platform'].split(' on ', 1)[1].split(' ')[0] + relay['platform'] = relay['platform'].split('/')[-1] # GNU/* def _fix_missing_observed_bandwidth(self): ''' |