stdlib: Fix CustomResource metadata

CustomResource's base class, AbstractResource, must be constructed with
a dictionary for the 'metadata' field. However, if the user did not
specify any metadata for the CustomResource, None is passed. This is
not permitted and can cause error. This patch ensures the metadata is
set to an empty dictionary by default

Change-Id: I358725ee6982dc9c6410eac3ad8194fa676dd326
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53843
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2021-12-08 22:50:29 -08:00
committed by Bobby Bruce
parent ef34cd0a00
commit 69255abeb0

View File

@@ -73,7 +73,7 @@ class CustomResource(AbstractResource):
repository.
"""
def __init__(self, local_path: str, metadata: Optional[Dict] = None):
def __init__(self, local_path: str, metadata: Dict = {}):
"""
:param local_path: The path of the resource on the host system.
:param metadata: Add metadata for the custom resource.