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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user