Merge "Correct the share server's db info after its deletion"

This commit is contained in:
Jenkins 2015-02-13 06:01:59 +00:00 committed by Gerrit Code Review
commit fd5e0f8eb9
2 changed files with 5 additions and 2 deletions

View File

@ -1860,7 +1860,10 @@ def share_server_delete(context, id):
with session.begin():
server_ref = share_server_get(context, id, session=session)
share_server_backend_details_delete(context, id, session=session)
server_ref.delete(session=session)
server_ref.update({'deleted': server_ref.id,
'deleted_at': timeutils.utcnow(),
'updated_at': literal_column('updated_at'),
'status': constants.STATUS_DELETED})
@require_context

View File

@ -369,7 +369,7 @@ class ShareServer(BASE, ManilaBase):
host = Column(String(255), nullable=False)
status = Column(Enum(constants.STATUS_INACTIVE, constants.STATUS_ACTIVE,
constants.STATUS_ERROR, constants.STATUS_DELETING,
constants.STATUS_CREATING),
constants.STATUS_CREATING, constants.STATUS_DELETED),
default=constants.STATUS_INACTIVE)
network_allocations = orm.relationship(
"NetworkAllocation",