Merge pull request #5113 from aws-lumberyard-dev/Prism/ReposExceptionFix
Fix thrown exceptions if repos does not exist in the manifest
This commit is contained in:
@@ -477,11 +477,11 @@ def register_repo(json_data: dict,
|
||||
parsed_uri = urllib.parse.urlparse(url)
|
||||
|
||||
if parsed_uri.scheme in ['http', 'https', 'ftp', 'ftps']:
|
||||
while repo_uri in json_data['repos']:
|
||||
while repo_uri in json_data.get('repos', []):
|
||||
json_data['repos'].remove(repo_uri)
|
||||
else:
|
||||
repo_uri = pathlib.Path(repo_uri).resolve().as_posix()
|
||||
while repo_uri in json_data['repos']:
|
||||
while repo_uri in json_data.get('repos', []):
|
||||
json_data['repos'].remove(repo_uri)
|
||||
|
||||
if remove:
|
||||
@@ -492,7 +492,7 @@ def register_repo(json_data: dict,
|
||||
|
||||
result = utils.download_file(parsed_uri, cache_file)
|
||||
if result == 0:
|
||||
json_data['repos'].insert(0, repo_uri)
|
||||
json_data.setdefault('repos', []).insert(0, repo_uri)
|
||||
|
||||
repo_set = set()
|
||||
result = repo.process_add_o3de_repo(cache_file, repo_set)
|
||||
|
||||
@@ -147,7 +147,7 @@ def get_gem_json_paths_from_all_cached_repos() -> set:
|
||||
json_data = manifest.load_o3de_manifest()
|
||||
gem_set = set()
|
||||
|
||||
for repo_uri in json_data['repos']:
|
||||
for repo_uri in json_data.get('repos', []):
|
||||
gem_set.update(get_gem_json_paths_from_cached_repo(repo_uri))
|
||||
|
||||
return gem_set
|
||||
@@ -189,7 +189,7 @@ def refresh_repos() -> int:
|
||||
# set will stop circular references
|
||||
repo_set = set()
|
||||
|
||||
for repo_uri in json_data['repos']:
|
||||
for repo_uri in json_data.get('repos', []):
|
||||
if repo_uri not in repo_set:
|
||||
repo_set.add(repo_uri)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user