Do not filter empty strings
Empty strings shouldn't be filtered from requests, as we have explicitly set some attributes to be optional and actually differentiate between null and empty attributes in the server side. So now, only attributes containing None are filtered and empty strings are actually passed to the server. Change-Id: Ia048d7de6bcbc12317930eeccc009b6b0db10e13 Closes-bug: #1420445
This commit is contained in:
parent
347d034d46
commit
8c9024337c
|
@ -20,8 +20,8 @@ import uuid
|
|||
import six
|
||||
|
||||
|
||||
def filter_empty_keys(dictionary):
|
||||
return dict(((k, v) for k, v in dictionary.items() if v))
|
||||
def filter_null_keys(dictionary):
|
||||
return dict(((k, v) for k, v in dictionary.items() if v is not None))
|
||||
|
||||
|
||||
def validate_ref(ref, entity):
|
||||
|
|
|
@ -182,7 +182,7 @@ class Container(ContainerFormatter):
|
|||
"""Store Container in Barbican"""
|
||||
secret_refs = self._get_secrets_and_store_them_if_necessary()
|
||||
|
||||
container_dict = base.filter_empty_keys({
|
||||
container_dict = base.filter_null_keys({
|
||||
'name': self.name,
|
||||
'type': self._type,
|
||||
'secret_refs': secret_refs
|
||||
|
|
|
@ -108,7 +108,7 @@ class Order(object):
|
|||
|
||||
self._order_ref = order_ref
|
||||
|
||||
self._meta = base.filter_empty_keys(meta)
|
||||
self._meta = base.filter_null_keys(meta)
|
||||
|
||||
self._error_status_code = error_status_code
|
||||
self._error_reason = error_reason
|
||||
|
|
|
@ -232,7 +232,7 @@ class Secret(SecretFormatter):
|
|||
Stores the Secret in Barbican. New Secret objects are not persisted
|
||||
in Barbican until this method is called.
|
||||
"""
|
||||
secret_dict = base.filter_empty_keys({
|
||||
secret_dict = base.filter_null_keys({
|
||||
'name': self.name,
|
||||
'payload': self.payload,
|
||||
'payload_content_type': self.payload_content_type,
|
||||
|
|
Loading…
Reference in New Issue