[tor-commits] [sbws/maint-1.1] fix: v3bwfile: Add constant for ordered key/values

juga at torproject.org juga at torproject.org
Mon Mar 9 14:38:02 UTC 2020


commit 017c7c100d39007176edb080128a5bf96e61080d
Author: juga0 <juga at riseup.net>
Date:   Sun Feb 9 16:46:28 2020 +0000

    fix: v3bwfile: Add constant for ordered key/values
    
    to build the list of all keys from it and ensure no key is missing.
---
 sbws/lib/v3bwfile.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index dc85a37..a232093 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -32,6 +32,8 @@ KEYVALUE_SEP_V2 = ' '
 
 # Header KeyValues
 # =================
+# KeyValues that need to be in a specific order in the Bandwidth File.
+HEADER_KEYS_V1_1_ORDERED = ['version']
 # List of the extra KeyValues accepted by the class
 HEADER_KEYS_V1X = [
     "software",
@@ -114,7 +116,7 @@ HEADER_UNORDERED_KEYS = HEADER_KEYS_V1X + HEADER_KEYS_V1_2 + \
                       ['latest_bandwidth'] + \
                       HEADER_KEYS_V1_4
 # List of all the KeyValues currently being used to generate the file
-HEADER_ALL_KEYS = ['version'] + HEADER_UNORDERED_KEYS
+HEADER_ALL_KEYS = HEADER_KEYS_V1_1_ORDERED + HEADER_UNORDERED_KEYS
 
 TERMINATOR = '====='
 





More information about the tor-commits mailing list