Comment 3 for bug 1744692

Revision history for this message
TommyLike (hu-husheng) wrote :

By searching the cinder code, I found the snapshot object that is being used in the method is a temporary object made via namedtuple, and that means the OVO attribute '_context' is missing since it's made [1]. I don't have an environment by hand, not sure this change can fix the error.

```
snap_attrs = ['volume_name', 'volume_size', 'name',
                          'volume_id', 'id', 'volume', '_context']
            Snapshot = collections.namedtuple('Snapshot', snap_attrs)
            temp_snapshot = Snapshot(volume_name=volume_name,
                                     volume_size=src_vref.size,
                                     name='clone-snap-%s' % src_vref.id,
                                     volume_id=src_vref.id,
                                     id='tmp-snap-%s' % src_vref.id,
                                     volume=src_vref,
                                     _context=src_vref._context)
```

[1]: https://github.com/openstack/cinder/blob/5dcf4f52ada36b98d08584cd31a55698006d9e35/cinder/volume/drivers/remotefs.py#L1044