Fix creation of hashmap mapping with a zero cost

A cost of 0.0 was interpreted as a False value, making the check think
the cost argument was missing.

Change-Id: I5f86540221b80667fc63b8b54659092c637b7353
Story: 2009047
Task: 42814
This commit is contained in:
Pierre Riteau
2021-07-12 19:31:06 +02:00
parent b1df2b5ccc
commit 61ef2c337e
2 changed files with 5 additions and 1 deletions

View File

@@ -172,7 +172,7 @@ class HashmapManager(base.BaseManager):
:param value: Value of the mapping
:type value: str
"""
if not kwargs.get('cost'):
if kwargs.get('cost') is None:
raise exc.ArgumentRequired("'cost' argument is required")
if not kwargs.get('value'):
if not kwargs.get('service_id'):

View File

@@ -0,0 +1,4 @@
---
fixes:
- |
Fixes creation of hashmap mappings with a zero cost.