Skip to content

Commit 1e8b062

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix create_threshold method when using cost as 0"
2 parents c2b5ed9 + a15f11a commit 1e8b062

5 files changed

Lines changed: 29 additions & 21 deletions

File tree

cloudkittyclient/v1/rating/hashmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def create_threshold(self, **kwargs):
373373
:type level: str
374374
"""
375375
for arg in ['cost', 'level']:
376-
if not kwargs.get(arg):
376+
if kwargs.get(arg) is None:
377377
raise exc.ArgumentRequired(
378378
"'{}' argument is required".format(arg))
379379
if not kwargs.get('service_id') and not kwargs.get('field_id'):

lower-constraints.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# requirements
2-
pbr==2.0.0 # Apache-2.0
3-
cliff==2.11.0 # Apache-2.0
4-
keystoneauth1==3.4.0 # Apache-2.0
5-
oslo.utils==3.35 # Apache-2.0
6-
oslo.log==3.36 # Apache-2.0
7-
PyYAML==3.12 # MIT
8-
jsonpath-rw-ext==1.0 # Apache-2.0
9-
os-client-config==1.29.0 # Apache-2.0
10-
osc-lib==1.12.1 # Apache-2.0
2+
pbr==5.5.1 # Apache-2.0
3+
cliff==3.5.0 # Apache-2.0
4+
keystoneauth1==4.3.0 # Apache-2.0
5+
oslo.utils==4.7.0 # Apache-2.0
6+
oslo.log==4.4.0 # Apache-2.0
7+
PyYAML==5.3.1 # MIT
8+
jsonpath-rw-ext==1.2.0 # Apache-2.0
9+
os-client-config==2.1.0 # Apache-2.0
10+
osc-lib==2.3.0 # Apache-2.0
1111

1212
# test-requirements.txt
1313
pyflakes==2.1.1
1414
coverage==4.0 # Apache-2.0
15-
python-subunit==0.0.18 # Apache-2.0/BSD
15+
python-subunit==1.4.0 # Apache-2.0/BSD
1616
oslotest==1.10.0 # Apache-2.0
1717
stestr==2.0 # Apache-2.0
1818
python-openstackclient==3.14 # Apache-2.0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
fixes:
3+
- |
4+
Fix `create_threshold` method when using cost as 0.
5+
When using 0 as the cost, the `create_threshold` method
6+
throws an exception. That happens because 0 (zero) is evaluated
7+
to False. Therefore, we need to change the validation method to
8+
check if the values are None.

requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# of appearance. Changing the order has an impact on the overall integration
33
# process, which may cause wedges in the gate later.
44

5-
pbr>=2.0.0,!=2.1.0 # Apache-2.0
6-
cliff>=2.11.0 # Apache-2.0
7-
keystoneauth1>=3.4.0 # Apache-2.0
8-
oslo.utils>=3.35 # Apache-2.0
9-
oslo.log>=3.36 # Apache-2.0
10-
PyYAML>=3.12 # MIT
11-
jsonpath-rw-ext>=1.0 # Apache-2.0
12-
os-client-config>=1.29.0 # Apache-2.0
13-
osc-lib>=1.12.1 # Apache-2.0
5+
pbr>=5.5.1 # Apache-2.0
6+
cliff>=3.5.0 # Apache-2.0
7+
keystoneauth1>=4.3.0 # Apache-2.0
8+
oslo.utils>=4.7.0 # Apache-2.0
9+
oslo.log>=4.4.0 # Apache-2.0
10+
PyYAML>=5.3.1 # MIT
11+
jsonpath-rw-ext>=1.2.0 # Apache-2.0
12+
os-client-config>=2.1.0 # Apache-2.0
13+
osc-lib>=2.3.0 # Apache-2.0

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0
1010
pyflakes>=2.1.1
1111

1212
coverage>=4.0,!=4.4 # Apache-2.0
13-
python-subunit>=0.0.18 # Apache-2.0/BSD
13+
python-subunit>=1.4.0 # Apache-2.0/BSD
1414
oslotest>=1.10.0 # Apache-2.0
1515
stestr>=2.0 # Apache-2.0
1616
python-openstackclient>=3.14 # Apache-2.0

0 commit comments

Comments
 (0)