浏览代码

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 年之前
父节点
当前提交
1a60007129
共有 1 个文件被更改,包括 5 次插入6 次删除
  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: