@wrap_check_policy
def update_volume_metadata(self, context, volume, metadata, delete=False):
    'Updates or creates volume metadata.\n\n        If delete is True, metadata items that are not specified in the\n        `metadata` argument will be deleted.\n\n        '
    if delete:
        _metadata = metadata
    else:
        _metadata = self.get_volume_metadata(context, volume['id'])
        _metadata.update(metadata)
    self.db.volume_metadata_update(context, volume['id'], _metadata, True)
    return _metadata
Updates or creates volume metadata.

If delete is True, metadata items that are not specified in the
`metadata` argument will be deleted.
@wrap_check_policy
def update_volume_metadata(self, context, volume, metadata, delete=False):
    'Updates or creates volume metadata.\n\n        If delete is True, metadata items that are not specified in the\n        `metadata` argument will be deleted.\n\n        '
    if delete:
        _metadata = metadata
    else:
        _metadata = self.get_volume_metadata(context, volume['id'])
        _metadata.update(metadata)
    self.db.volume_metadata_update(context, volume['id'], _metadata, True)
    return _metadata