ソースを参照

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: