summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harwell <flux.adam@gmail.com>2015-03-16 15:13:28 -0500
committerAdam Harwell <flux.adam@gmail.com>2015-03-16 15:13:28 -0500
commit16a886c007a20e73527bf95c19b2ef9a83d2c4d7 (patch)
treeb68fced4e47423e9384ad9071082267cab01a6b1
parent44b045bfbdafb59609279ce26e98ee49022f7c42 (diff)
downloadpython-barbicanclient-16a886c007a20e73527bf95c19b2ef9a83d2c4d7.tar.gz
Fix secret-store empty-key filtering bug
The "secret store" action filters out empty keys too early in the process, which can cause None to be passed as the content-encoding in some cases. Change-Id: I2bee838f9f9e9c4cf51109083f7e4dc8068f6711
-rw-r--r--barbicanclient/secrets.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/barbicanclient/secrets.py b/barbicanclient/secrets.py
index fca7dd0..a92edd1 100644
--- a/barbicanclient/secrets.py
+++ b/barbicanclient/secrets.py
@@ -249,13 +249,13 @@ 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_null_keys({
+ secret_dict = {
'name': self.name,
'algorithm': self.algorithm,
'mode': self.mode,
'bit_length': self.bit_length,
'expiration': self.expiration
- })
+ }
if self.payload_content_type:
"""
@@ -286,6 +286,8 @@ class Secret(SecretFormatter):
secret_dict['payload'] = self.payload
secret_dict['payload_content_type'] = u'text/plain'
+ secret_dict = base.filter_null_keys(secret_dict)
+
LOG.debug("Request body: {0}".format(secret_dict))
# Save, store secret_ref and return