From 21deca8a4ba0444270ca1cb7c692a35012923ae7 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Hoai Date: Sat, 2 Dec 2017 11:14:42 +0700 Subject: [PATCH] Remove redundancy code When we pass secret_mode and kek_datum_model to EndcryptedDatum [1], the __init__ function of the class set secret_id attribute [2]. So no need to have the line of code #346 [3] [1] https://github.com/openstack/barbican/blob/master/barbican/plugin/store_crypto.py#L312 [2] https://github.com/openstack/barbican/blob/master/barbican/model/models.py#L457 [3] https://github.com/openstack/barbican/blob/master/barbican/plugin/store_crypto.py#L316 Change-Id: Ia419dccfc73aba88d4e00384a0a11926781bfeb3 --- barbican/plugin/store_crypto.py | 1 - 1 file changed, 1 deletion(-) diff --git a/barbican/plugin/store_crypto.py b/barbican/plugin/store_crypto.py index 41a7e6a36..c13e59c2b 100644 --- a/barbican/plugin/store_crypto.py +++ b/barbican/plugin/store_crypto.py @@ -313,7 +313,6 @@ def _store_secret_and_datum( datum_model.content_type = context.content_type datum_model.cypher_text = base64.b64encode(generated_dto.cypher_text) datum_model.kek_meta_extended = generated_dto.kek_meta_extended - datum_model.secret_id = secret_model.id repositories.get_encrypted_datum_repository().create_from( datum_model)