소스 검색

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 optparse
 import os
 import os
 import requests
 import requests
-import collections
 
 
 
 
 # TODO: move this to base/configs/whitelisted_custom_tag_remotes.json
 # 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:
     for remote in remotes:
         try:
         try: