Fix setting custom property on os_project

When a new property is created on a project, verifies if the
key is in the dict before checking its value for changes.

Story: 2008530
Task: 41613
Change-Id: I5db452e0719b45932dda068e32f4876c098fea77
Signed-off-by: Lucas Galton <lucas@galton.fr>
This commit is contained in:
Lucas Galton
2021-01-20 12:12:21 +01:00
parent 049a2de725
commit b7c22515b7

View File

@@ -115,7 +115,7 @@ def _needs_update(module, project):
if properties:
project_properties = project.get('properties')
for k, v in properties.items():
if v is not None and v != project_properties[k]:
if v is not None and (k not in project_properties or v != project_properties[k]):
return True
return False