Creating a secret gives misleading update timestamp

Bug #1382188 reported by Thomas Dinkjian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Low
Michael McCune

Bug Description

When creating a secret the created time gets set when the python object is created and the updated time is set at database write. This causes the times to be slightly different which can be confusing. The times not matching makes it seem as if the secret was already updated when it has not been updated, only created. The updated field should either match the created or be empty.

Tags: verified
Changed in barbican:
status: New → Confirmed
importance: Undecided → Low
milestone: none → kilo-1
Revision history for this message
John Wood (john-wood-w) wrote :

I believe this would be as simple as modifying the code that saves entities and set the updated-at date, so that it only does this if the ID of the entity is non None. That way when an entity is created (and so has no ID) it can be saved whatever time later and flushed to the database without need to set the updated date.

Changed in barbican:
milestone: kilo-1 → none
Changed in barbican:
assignee: nobody → Michael McCune (mimccune)
Changed in barbican:
milestone: none → kilo-1
Changed in barbican:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to barbican (master)

Reviewed: https://review.openstack.org/140423
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=d163550914bb78f4e0bc8c316d79dfd50f9a47f6
Submitter: Jenkins
Branch: master

commit d163550914bb78f4e0bc8c316d79dfd50f9a47f6
Author: Michael McCune <email address hidden>
Date: Tue Dec 9 13:10:17 2014 -0500

    Changing ModelBase.save to correct updated time

    This change modifies the updated_at time property for new ModelBase
    objects. When the save method is called for a new object that does not yet
    have an id assigned, the created_at and updated_at times are set to the
    same value.

    Changes
    * modified ModelBase.save method for new objects
    * adding a test to confirm new secrets have the same created_at and
      updated_at times

    Change-Id: I3a64c05fdc21dd3e07852aa750ea4c099564da65
    Closes-Bug: #1382188

Changed in barbican:
status: In Progress → Fix Committed
tags: added: verified
Thierry Carrez (ttx)
Changed in barbican:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in barbican:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.