'When scheduling fails send out an event that it failed.'

@utils.if_notifications_enabled
def _notify_failure(self, context, request_spec, cause):

    payload = {'request_spec': request_spec, 'volume_properties': request_spec.get('volume_properties', {}), 'volume_id': request_spec['volume_id'], 'state': 'error', 'method': 'create_volume', 'reason': cause}
    try:
        rpc.get_notifier('scheduler').error(context, self.FAILURE_TOPIC, payload)
    except exception.CinderException:
        LOG.exception('Failed    notifying    on    %(topic)s    payload    %(payload)s', {'topic': self.FAILURE_TOPIC, 'payload': payload})
