Bladeren bron

scripts: initiliase empty versions map

We use this map to update remotes.json. We need to have blank lists for vehicles and remotes for which we do not see any tags. This lets us process the entries for the same in remotes.json and remove tags listed there which have been deleted.
Shiv Tyagi 1 jaar geleden
bovenliggende
commit
1a60007129
1 gewijzigde bestanden met toevoegingen van 5 en 6 verwijderingen
  1. 5 6
      scripts/fetch_whitelisted_tags.py

+ 5 - 6
scripts/fetch_whitelisted_tags.py

@@ -29,7 +29,6 @@ import json
 import optparse
 import os
 import requests
-import collections
 
 
 # TODO: move this to base/configs/whitelisted_custom_tag_remotes.json
@@ -98,11 +97,11 @@ def construct_versions_map(remotes, vehicles):
     }
     """
 
-    ret = collections.defaultdict(
-        lambda: collections.defaultdict(
-            list
-        )
-    )
+    ret = {
+        remote: {
+            vehicle: [] for vehicle in vehicles
+        } for remote in remotes
+    }
 
     for remote in remotes:
         try: