Skip to content

Commit 61ef2c3

Browse files
committed
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
1 parent b1df2b5 commit 61ef2c3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

cloudkittyclient/v1/rating/hashmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def create_mapping(self, **kwargs):
172172
:param value: Value of the mapping
173173
:type value: str
174174
"""
175-
if not kwargs.get('cost'):
175+
if kwargs.get('cost') is None:
176176
raise exc.ArgumentRequired("'cost' argument is required")
177177
if not kwargs.get('value'):
178178
if not kwargs.get('service_id'):
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes creation of hashmap mappings with a zero cost.

0 commit comments

Comments
 (0)