Add metadata aliases to Volume object
When writing Volume object we've renamed some fields from SQLAlchemy
model. This included volume_metadata (renamed to metadata) and
volume_admin_metadata (renamed to admin_metadata) and
volume_glance_metadata (recently added as glance_metadata). Some code
were relying on old names. As right now we're in the transitional phase
it's hard to tell if driver method will get versioned object or old
SQLAlchemy object.
To mitigate that and mimic old SQLAlchemy object behavior on versioned
object we should add properties to serve as aliases for older names.
This commit also fixes the tests for EMC VNX that were blocking the
patch. Tests were setting volume_metadata property on volume object,
which actually had no effect without this patch.
Another thing done is moving overriding __contains__ from
CinderObjectDictCompat to CinderObject class to solve MRO issue because
both of these classes were defining __contains__ method.
Change-Id: I79e24c5ad20f17bb6b21b2d47f955afde47d9794
Closes-Bug:
1529877
Related-Bug:
1516903