Fix service clients for kwargs as None or 0
images_client and servers_client, does not allow
to pass 0/none/false etc for few requetst param.
Service client interfaces should check existence if
those in kwargs instead of their value and
then populate the request body arg.
Change-Id: I40f5ef84ab90509722b485a5f38a97d8fbc1d37c
diff --git a/tempest/lib/services/compute/servers_client.py b/tempest/lib/services/compute/servers_client.py
index 24557d8..597e815 100644
--- a/tempest/lib/services/compute/servers_client.py
+++ b/tempest/lib/services/compute/servers_client.py
@@ -100,7 +100,7 @@
any changes.
:param disk_config: The name is changed to OS-DCF:diskConfig
"""
- if kwargs.get('disk_config'):
+ if 'disk_config' in kwargs:
kwargs['OS-DCF:diskConfig'] = kwargs.pop('disk_config')
post_body = json.dumps({'server': kwargs})
diff --git a/tempest/lib/services/image/v1/images_client.py b/tempest/lib/services/image/v1/images_client.py
index e67a547..03f4c4b 100644
--- a/tempest/lib/services/image/v1/images_client.py
+++ b/tempest/lib/services/image/v1/images_client.py
@@ -115,7 +115,7 @@
if detail:
url += '/detail'
- if kwargs.get('changes_since'):
+ if 'changes_since' in kwargs:
kwargs['changes-since'] = kwargs.pop('changes_since')
if len(kwargs) > 0: