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
This commit is contained in:
Nam Nguyen Hoai 2017-12-02 11:14:42 +07:00
parent 128cdd1e80
commit 21deca8a4b

View File

@ -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)