diff --git a/solar/solar/core/resource/resource.py b/solar/solar/core/resource/resource.py index 35f9acac..65dfa2e4 100644 --- a/solar/solar/core/resource/resource.py +++ b/solar/solar/core/resource/resource.py @@ -39,7 +39,8 @@ class Resource(object): # Create @dispatch(str, str) - def __init__(self, name, base_path, args={}, tags=None, virtual_resource=None): + def __init__(self, name, base_path, args=None, tags=None, virtual_resource=None): + args = args or {} self.name = name if base_path: metadata = read_meta(base_path) @@ -86,7 +87,8 @@ class Resource(object): k: v for k, v in ret.items() if os.path.isfile(v) } - def create_inputs(self, args={}): + def create_inputs(self, args=None): + args = args or {} for name, v in self.db_obj.meta_inputs.items(): value = args.get(name, v.get('value')) diff --git a/solar/solar/core/resource/virtual_resource.py b/solar/solar/core/resource/virtual_resource.py index e2522d9f..d9e32bc3 100644 --- a/solar/solar/core/resource/virtual_resource.py +++ b/solar/solar/core/resource/virtual_resource.py @@ -24,7 +24,8 @@ from solar.core import resource from solar.core import signals -def create(name, base_path, args={}, virtual_resource=None): +def create(name, base_path, args=None, virtual_resource=None): + args = args or {} if isinstance(base_path, provider.BaseProvider): base_path = base_path.directory @@ -47,7 +48,8 @@ def create(name, base_path, args={}, virtual_resource=None): return rs -def create_resource(name, base_path, args={}, virtual_resource=None): +def create_resource(name, base_path, args=None, virtual_resource=None): + args = args or {} if isinstance(base_path, provider.BaseProvider): base_path = base_path.directory