示例#1
0
    def test_volume_type_delete_with_group_in_use(self):
        volume_type = db.volume_type_create(self.ctxt,
                                            {'name': 'fake volume type'})

        group = db.group_create(self.ctxt, {})
        db.group_volume_type_mapping_create(self.ctxt, group['id'],
                                            volume_type['id'])
        self.assertRaises(exception.VolumeTypeInUse, volume_types.destroy,
                          self.ctxt, volume_type['id'])
        db.group_destroy(self.ctxt, group['id'])
        volume_types.destroy(self.ctxt, volume_type['id'])
    def test_volume_type_delete_with_group_in_use(self):
        volume_type = db.volume_type_create(self.ctxt, {'name':
                                                        'fake volume type'})

        group = db.group_create(self.ctxt, {})
        db.group_volume_type_mapping_create(self.ctxt, group['id'],
                                            volume_type['id'])
        self.assertRaises(exception.VolumeTypeInUse, volume_types.destroy,
                          self.ctxt, volume_type['id'])
        db.group_destroy(self.ctxt, group['id'])
        volume_types.destroy(self.ctxt, volume_type['id'])
示例#3
0
文件: group.py 项目: Nexenta/cinder
 def destroy(self):
     with self.obj_as_admin():
         db.group_destroy(self._context, self.id)
示例#4
0
 def destroy(self):
     with self.obj_as_admin():
         db.group_destroy(self._context, self.id)