with session.begin():
session.query(models.Volume).\
filter_by(id=volume_id).\
- update({'deleted': True,
+ update({'status': 'deleted',
+ 'deleted': True,
'deleted_at': timeutils.utcnow(),
'updated_at': literal_column('updated_at')})
session.query(models.IscsiTarget).\
with session.begin():
session.query(models.Snapshot).\
filter_by(id=snapshot_id).\
- update({'deleted': True,
+ update({'status': 'deleted',
+ 'deleted': True,
'deleted_at': timeutils.utcnow(),
'updated_at': literal_column('updated_at')})
volume_id).id)
self.volume.delete_volume(self.context, volume_id)
+ vol = db.volume_get(context.get_admin_context(read_deleted='yes'),
+ volume_id)
+ self.assertEquals(vol['status'], 'deleted')
self.assertEquals(len(test_notifier.NOTIFICATIONS), 4)
self.assertRaises(exception.NotFound,
db.volume_get,
snapshot_id).id)
self.volume.delete_snapshot(self.context, snapshot_id)
+ snap = db.snapshot_get(context.get_admin_context(read_deleted='yes'),
+ snapshot_id)
+ self.assertEquals(snap['status'], 'deleted')
self.assertRaises(exception.NotFound,
db.snapshot_get,
self.context,