init share server updated_at field
to be able to always make a judgement about the age for automatic cleanup Change-Id: Ic7d3925035b1563d8acc8f5f24a72231b49a2c89 Closes-Bug: #1993828
This commit is contained in:
parent
031fab2c8f
commit
ed65c4bb1f
@ -4525,6 +4525,8 @@ def share_server_create(context, values):
|
||||
values = ensure_model_dict_has_id(values)
|
||||
|
||||
server_ref = models.ShareServer()
|
||||
# updated_at is needed for judgement of automatic cleanup
|
||||
server_ref.updated_at = timeutils.utcnow()
|
||||
server_ref.update(values)
|
||||
session = get_session()
|
||||
with session.begin():
|
||||
|
@ -148,7 +148,7 @@ class ShareServerControllerTest(test.TestCase):
|
||||
'share_server': {
|
||||
'id': share_server['id'],
|
||||
'project_id': 'fake',
|
||||
'updated_at': None,
|
||||
'updated_at': share_server['updated_at'],
|
||||
'status': constants.STATUS_ACTIVE,
|
||||
'host': 'fake_host',
|
||||
'share_network_id':
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
On share server creation initialize the updated_at field with the current
|
||||
timestamp to fix broken automatic cleanup in rare occasions where a share
|
||||
server that would be an automatic cleanup target would be pending in state
|
||||
`creating` forever.
|
Loading…
x
Reference in New Issue
Block a user