fix: Fix params' default value of function

1. Do not use mutable types as method parameter defaults

Change-Id: Ie310114f53981451b50a366a0869be72bbfb4e01
This commit is contained in:
chenliufeiyang 2021-08-20 15:11:12 +08:00
parent 988f38cc41
commit ebf89092fd
2 changed files with 3 additions and 2 deletions

View File

@ -28,7 +28,7 @@ from skyline_apiserver.client import utils
async def list_images(
profile: schemas.Profile,
session: Session,
filters: Dict[str, Any] = {},
filters: Dict[str, Any] = None,
) -> Any:
try:
kwargs = {}

View File

@ -29,9 +29,10 @@ async def list_projects(
profile: schemas.Profile,
all_projects: bool,
session: Session,
search_opts: Dict[str, Any] = {},
search_opts: Dict[str, Any] = None,
) -> Any:
try:
search_opts = search_opts if search_opts else {}
kc = await utils.keystone_client(session=session, region=profile.region)
if not all_projects:
search_opts["user"] = profile.user.id